KUBERNETES(1) kubernetes KUBERNETES(1) (NAME) kubectl-get - (SYNOPSIS) kubectl get [OPTIONS] (DESCRIPTION) . . --selector . (namespaced) . 'template' Go --template . "kubectl api-resources" . (OPTIONS) -A, --all-namespaces=false . --namespace . --allow-missing-template-keys=true true . golang jsonpath . --chunk-size=500 (chunk) . 0 . --field-selector="" ( ) '=' '==' '!=' ( --field-selector key1=value1,key2=value2). . -f, --filename=[] URL . --ignore-not-found=false true NotFound . . -k, --kustomize="" kustomization. -f -R . -L, --label-columns=[] . . -L label1 -L label2... . --no-headers=false (custom-column) ( ). -o, --output="" . : (json, yaml, kyaml, name, go-template, go-template-file, template, templatefile, jsonpath, jsonpath-as-json, jsonpath-file, custom- columns, custom-columns-file, wide). [https://kubernetes.io/docs/reference/kubectl/#custom-columns] golang [http://golang.org/pkg/text/template/#pkg- overview] jsonpath [https://kubernetes.io/docs/reference/kubectl/jsonpath] . --output-watch-events=false (watch event) --watch --watch- only. ADDED . --raw="" URI . kubeconfig . -R, --recursive=false -f --filename. . -l, --selector="" ( ) '=' '==' '!=' 'in' 'notin' ( -l key1=value1,key2=value2,key3 in (value3)). . --server-print=true true . API CRD . --show-kind=false . --show-labels=false ( ). --show-managed-fields=false true (managedFields) JSON YAML . --sort-by="" . JSONPath ( '{.metadata.name}'). JSONPath API . --subresource="" (subresource) . --template="" -o=go-template -o=go-template-file . golang [http://golang.org/pkg/text/template/#pkg-overview]. -w, --watch=false / (watch). --watch-only=false / . (OPTIONS INHERITED FROM PARENT COMMANDS) --as="" (impersonate) . (service account) namespace . --as-group=[] . --as-uid="" UID . --as-user-extra=[] . --cache-dir="/home/username/.kube/cache" --certificate-authority="" (certificate authority) --client-certificate="" TLS --client-key="" TLS --cluster="" kubeconfig --context="" kubeconfig --disable-compression=false true --insecure-skip-tls-verify=false true . HTTPS --kubeconfig="" kubeconfig CLI. --kuberc="" kuberc (preferences). export feature gate KUBECTL_KUBERC=false KUBERC=off . --match-server-version=false -n, --namespace="" namespace CLI --password="" (basic authentication) API --profile="none" . (none|cpu|heap|goroutine|threadcreate|block|mutex|trace) --profile-output="profile.pprof" --request-timeout="0" . ( 1s 2m 3h). ( timeout). -s, --server="" Kubernetes API --tls-server-name="" . hostname --token="" Bearer API --user="" kubeconfig --username="" API --version=false --version --version=raw --version=vX.Y.Z... --warnings-as-errors=false (EXAMPLE) # ps kubectl get pods # ps ( ) kubectl get pods -o wide # replication controller ps kubectl get replicationcontroller web # JSON "v1" API "apps" kubectl get deployments.v1.apps -o json # JSON kubectl get -o json pod web-pod-13je7 # "pod.yaml" JSON kubectl get -f pod.yaml -o json # kustomization.yaml - dir/kustomization.yaml kubectl get -k dir/ # phase kubectl get -o template pod/web-pod-13je7 --template={{.status.phase}} # kubectl get pod test-pod -o custom-columns=CONTAINER:.spec.containers[0].name,IMAGE:.spec.containers[0].image # ps kubectl get rc,services # kubectl get rc/web service/frontend pods/web-pod-13je7 # 'status' kubectl get pod web-pod-13je7 --subresource status # 'backend' kubectl get deployments.apps --namespace backend # kubectl get pods --all-namespaces (SEE ALSO) kubectl(1) (HISTORY) Eric Paris (eparis at redhat dot com) kubernetes ! Eric Paris Jan 2015 KUBERNETES(1)