kubectl get <TYPE | TYPE/NAME> [Resource]

Display one or many resources

Arguments

NameDescription
TYPE | TYPE/NAME
Resource

Options

NameDescription
--allow-missing-template-keysIf 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
--field-selector <arg>Selector (field query) to filter on, supports '=', '==', and '!='.(e.g. --field-selector key1=value1,key2=value2). The server only supports a limited number of field queries per type
-f, --filename <File>Filename, directory, or URL to files identifying the resource
-k, --kustomize <Kustomize Dir>Process the kustomization directory. This flag can't be used together with -f or -R
-o, --output <Output Format>Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-file
-R, --recursiveProcess the directory used in -f, --filename recursively. Useful when you want to manage related manifests organized within the same directory
-l, --selector <arg>Selector (label query) to filter on, not including uninitialized ones, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2)
--template <arg>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]
-A, --all-namespacesIf present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace
--chunk-size <arg>Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future
--ignore-not-foundIf the requested object does not exist the command will return exit code 0
-L, --label-columns <arg>Accepts a comma separated list of labels that are going to be presented as columns. Names are case-sensitive. You can also use multiple flag options like -L label1 -L label2
--no-headersWhen using the default or custom-column output format, don't print headers (default print headers)
--output-watch-eventsOutput watch event objects when --watch or --watch-only is used. Existing objects are output as initial ADDED events
--rawRaw URI to request from the server. Uses the transport specified by the kubeconfig file
--server-printIf true, have the server return the appropriate table output. Supports extension APIs and CRDs
--show-kindIf present, list the resource type for the requested object(s)
--show-labelsWhen printing, show all labels as the last column (default hide labels column)
--sort-by <arg>If non-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. '{.metadata.name}'). The field in the API resource specified by this JSONPath expression must be an integer or a string
-w, --watchAfter listing/getting the requested object, watch for changes. Uninitialized objects are excluded if no object name is provided
--watch-onlyWatch for changes to the requested object(s), without listing/getting first