kubectl config view --help

From wikieduonline
Revision as of 08:58, 8 June 2022 by Welcome (talk | contribs)
Jump to navigation Jump to search

Display merged kubeconfig settings or a specified kubeconfig file.

 You can use --output jsonpath={...} to extract specific values using a jsonpath expression.

Examples:
  # Show merged kubeconfig settings
  kubectl config view

  # Show merged kubeconfig settings and raw certificate data
  kubectl config view --raw

  # Get the password for the e2e user
  kubectl config view -o jsonpath='{.users[?(@.name == "e2e")].user.password}'

Options:
    --allow-missing-template-keys=true:
	If true, ignore any errors in templates when a field or map key is missing in the template. Only applies to
	golang and jsonpath output formats.

    --flatten=false:
	Flatten the resulting kubeconfig file into self-contained output (useful for creating portable kubeconfig
	files)

    --merge=true:
	Merge the full hierarchy of kubeconfig files

    --minify=false:
	Remove all information not used by current-context from the output

    -o, --output='yaml':
	Output format. One of: (json, yaml, name, go-template, go-template-file, template, templatefile, jsonpath,
	jsonpath-as-json, jsonpath-file).

    --raw=false:
	Display raw byte data

    --show-managed-fields=false:
	If true, keep the managedFields when printing objects in JSON or YAML format.

    --template='':
	Template string or path to template file to use when -o=go-template, -o=go-template-file. The template format
	is golang templates [http://golang.org/pkg/text/template/#pkg-overview].

Usage:
  kubectl config view [flags] [options]

Use "kubectl options" for a list of global command-line options (applies to all commands).

See also

Advertising: