From a6a5d359e59863ddd08ca84a69e5c8f8f7eb0b48 Mon Sep 17 00:00:00 2001
From: Qiming Teng
-Create a pod using the data in pod.json.
+Create a pod using the data in pod.json
kubectl create -f ./pod.json
-Create a pod based on the JSON passed into stdin.
+Create a pod based on the JSON passed into stdin
cat pod.json | kubectl create -f -
-Edit the data in docker-registry.yaml in JSON then create the resource using the edited data.
+Edit the data in docker-registry.yaml in JSON then create the resource using the edited data
kubectl create -f docker-registry.yaml --edit -o json
@@ -158,36 +158,36 @@ inspect them.
-Create a ClusterRole named "pod-reader" that allows user to perform "get", "watch" and "list" on pods
+Create a cluster role named "pod-reader" that allows user to perform "get", "watch" and "list" on pods
kubectl create clusterrole pod-reader --verb=get,list,watch --resource=pods
-Create a ClusterRole named "pod-reader" with ResourceName specified
+Create a cluster role named "pod-reader" with ResourceName specified
kubectl create clusterrole pod-reader --verb=get --resource=pods --resource-name=readablepod --resource-name=anotherpod
-Create a ClusterRole named "foo" with API Group specified
+Create a cluster role named "foo" with API Group specified
kubectl create clusterrole foo --verb=get,list,watch --resource=rs.extensions
-Create a ClusterRole named "foo" with SubResource specified
+Create a cluster role named "foo" with SubResource specified
kubectl create clusterrole foo --verb=get,list,watch --resource=pods,pods/status
-Create a ClusterRole name "foo" with NonResourceURL specified
+Create a cluster role name "foo" with NonResourceURL specified
kubectl create clusterrole "foo" --verb=get --non-resource-url=/logs/*
-Create a ClusterRole name "monitoring" with AggregationRule specified
+Create a cluster role name "monitoring" with AggregationRule specified
kubectl create clusterrole monitoring --aggregation-rule="rbac.example.com/aggregate-to-monitoring=true"
-Create a ClusterRole.
+Create a cluster role.
$ kubectl create clusterrole NAME --verb=verb --resource=resource.group [--resource-name=resourcename] [--dry-run=server|client|none]
-Create a ClusterRoleBinding for user1, user2, and group1 using the cluster-admin ClusterRole
+Create a cluster role binding for user1, user2, and group1 using the cluster-admin cluster role
kubectl create clusterrolebinding cluster-admin --clusterrole=cluster-admin --user=user1 --user=user2 --group=group1
-Create a ClusterRoleBinding for a particular ClusterRole.
+Create a cluster role binding for a particular cluster role.
$ kubectl create clusterrolebinding NAME --clusterrole=NAME [--user=username] [--group=groupname] [--serviceaccount=namespace:serviceaccountname] [--dry-run=server|client|none]
-Create a new configmap named my-config based on folder bar
+Create a new config map named my-config based on folder bar
kubectl create configmap my-config --from-file=path/to/bar
-Create a new configmap named my-config with specified keys instead of file basenames on disk
+Create a new config map named my-config with specified keys instead of file basenames on disk
kubectl create configmap my-config --from-file=key1=/path/to/bar/file1.txt --from-file=key2=/path/to/bar/file2.txt
-Create a new configmap named my-config with key1=config1 and key2=config2
+Create a new config map named my-config with key1=config1 and key2=config2
kubectl create configmap my-config --from-literal=key1=config1 --from-literal=key2=config2
-Create a new configmap named my-config from the key=value pairs in the file
+Create a new config map named my-config from the key=value pairs in the file
kubectl create configmap my-config --from-file=path/to/bar
-Create a new configmap named my-config from an env file
+Create a new config map named my-config from an env file
kubectl create configmap my-config --from-env-file=path/to/bar.env
-Create a configmap based on a file, directory, or specified literal value.
-A single configmap may package one or more key/value pairs.
-When creating a configmap based on a file, the key will default to the basename of the file, and the value will default to the file content. If the basename is an invalid key, you may specify an alternate key.
-When creating a configmap based on a directory, each file whose basename is a valid key in the directory will be packaged into the configmap. Any directory entries except regular files are ignored (e.g. subdirectories, symlinks, devices, pipes, etc).
+Create a config map based on a file, directory, or specified literal value.
+A single config map may package one or more key/value pairs.
+When creating a config map based on a file, the key will default to the basename of the file, and the value will default to the file content. If the basename is an invalid key, you may specify an alternate key.
+When creating a config map based on a directory, each file whose basename is a valid key in the directory will be packaged into the config map. Any directory entries except regular files are ignored (e.g. subdirectories, symlinks, devices, pipes, etc).
$ kubectl create configmap NAME [--from-file=[key=]source] [--from-literal=key1=value1] [--dry-run=server|client|none]
-Create a cronjob
+Create a cron job
kubectl create cronjob my-job --image=busybox --schedule="*/1 * * * *"
-Create a cronjob with command
+Create a cron job with a command
kubectl create cronjob my-job --image=busybox --schedule="*/1 * * * *" -- date
-Create a cronjob with the specified name.
+Create a cron job with the specified name.
$ kubectl create cronjob NAME --image=image --schedule='0/5 * * * ?' -- [COMMAND] [args...]
-Create a deployment named my-dep that runs the busybox image.
+Create a deployment named my-dep that runs the busybox image
kubectl create deployment my-dep --image=busybox
-Create a deployment with command
+Create a deployment with a command
kubectl create deployment my-dep --image=busybox -- date
-Create a deployment named my-dep that runs the nginx image with 3 replicas.
+Create a deployment named my-dep that runs the nginx image with 3 replicas
kubectl create deployment my-dep --image=nginx --replicas=3
-Create a deployment named my-dep that runs the busybox image and expose port 5701.
+Create a deployment named my-dep that runs the busybox image and expose port 5701
kubectl create deployment my-dep --image=busybox --port=5701
@@ -637,12 +637,6 @@ inspect them.
kubectl create job my-job --image=busybox
-Create a job with command
+Create a job with a command
kubectl create job my-job --image=busybox -- date
-Create a job from a CronJob named "a-cronjob"
+Create a job from a cron job named "a-cronjob"
kubectl create job test-job --from=cronjob/a-cronjob
@@ -1000,16 +994,16 @@ inspect them.
-Create a pod disruption budget named my-pdb that will select all pods with the app=rails label # and require at least one of them being available at any point in time.
+Create a pod disruption budget named my-pdb that will select all pods with the app=rails label # and require at least one of them being available at any point in time
kubectl create poddisruptionbudget my-pdb --selector=app=rails --min-available=1
-Create a pod disruption budget named my-pdb that will select all pods with the app=nginx label # and require at least half of the pods selected to be available at any point in time.
+Create a pod disruption budget named my-pdb that will select all pods with the app=nginx label # and require at least half of the pods selected to be available at any point in time
kubectl create pdb my-pdb --selector=app=nginx --min-available=50%
-Create a pod disruption budget with the specified name, selector, and desired minimum available pods
+Create a pod disruption budget with the specified name, selector, and desired minimum available pods.
$ kubectl create poddisruptionbudget NAME --selector=SELECTOR --min-available=N [--dry-run=server|client|none]
-Create a priorityclass named high-priority
+Create a priority class named high-priority
kubectl create priorityclass high-priority --value=1000 --description="high priority"
-Create a priorityclass named default-priority that considered as the global default priority
+Create a priority class named default-priority that is considered as the global default priority
kubectl create priorityclass default-priority --value=1000 --global-default=true --description="default priority"
-Create a priorityclass named high-priority that can not preempt pods with lower priority
+Create a priority class named high-priority that cannot preempt pods with lower priority
kubectl create priorityclass high-priority --value=1000 --description="high priority" --preemption-policy="Never"
-Create a priorityclass with the specified name, value, globalDefault and description
+Create a priority class with the specified name, value, globalDefault and description.
$ kubectl create priorityclass NAME --value=VALUE --global-default=BOOL [--dry-run=server|client|none]
-Create a new resourcequota named my-quota
+Create a new resource quota named my-quota
kubectl create quota my-quota --hard=cpu=1,memory=1G,pods=2,services=3,replicationcontrollers=2,resourcequotas=1,secrets=5,persistentvolumeclaims=10
-Create a new resourcequota named best-effort
+Create a new resource quota named best-effort
kubectl create quota best-effort --hard=pods=100 --scopes=BestEffort
-Create a resourcequota with the specified name, hard limits and optional scopes
+Create a resource quota with the specified name, hard limits, and optional scopes.
$ kubectl create quota NAME [--hard=key1=value1,key2=value2] [--scopes=Scope1,Scope2] [--dry-run=server|client|none]
-Create a Role named "pod-reader" that allows user to perform "get", "watch" and "list" on pods
+Create a role named "pod-reader" that allows user to perform "get", "watch" and "list" on pods
kubectl create role pod-reader --verb=get --verb=list --verb=watch --resource=pods
-Create a Role named "pod-reader" with ResourceName specified
+Create a role named "pod-reader" with ResourceName specified
kubectl create role pod-reader --verb=get --resource=pods --resource-name=readablepod --resource-name=anotherpod
-Create a Role named "foo" with API Group specified
+Create a role named "foo" with API Group specified
kubectl create role foo --verb=get,list,watch --resource=rs.extensions
-Create a Role named "foo" with SubResource specified
+Create a role named "foo" with SubResource specified
kubectl create role foo --verb=get,list,watch --resource=pods,pods/status
@@ -1391,11 +1385,11 @@ inspect them.
-Create a RoleBinding for user1, user2, and group1 using the admin ClusterRole
+Create a role binding for user1, user2, and group1 using the admin cluster role
kubectl create rolebinding admin --clusterrole=admin --user=user1 --user=user2 --group=group1
-Create a RoleBinding for a particular Role or ClusterRole.
+Create a role binding for a particular role or cluster role.
$ kubectl create rolebinding NAME --clusterrole=NAME|--role=NAME [--user=username] [--group=groupname] [--serviceaccount=namespace:serviceaccountname] [--dry-run=server|client|none]
That produces a ~/.dockercfg file that is used by subsequent 'docker push' and 'docker pull' commands to authenticate to the registry. The email address is optional.
When creating applications, you may have a Docker registry that requires authentication. In order for the - nodes to pull images on your behalf, they have to have the credentials. You can provide this information + nodes to pull images on your behalf, they must have the credentials. You can provide this information by creating a dockercfg secret and attaching it to your service account.
$ kubectl create docker-registry NAME --docker-username=user --docker-password=password --docker-email=email [--docker-server=string] [--from-file=[key=]source] [--dry-run=server|client|none]
-Create a new TLS secret named tls-secret with the given key pair:
+Create a new TLS secret named tls-secret with the given key pair
kubectl create secret tls tls-secret --cert=path/to/tls.cert --key=path/to/tls.key
Create a TLS secret from the given public/private key pair.
-The public/private key pair must exist before hand. The public key certificate must be .PEM encoded and match the given private key.
+The public/private key pair must exist beforehand. The public key certificate must be .PEM encoded and match the given private key.
$ kubectl create tls NAME --cert=path/to/cert/file --key=path/to/key/file [--dry-run=server|client|none]
Create a service using specified subcommand.
+Create a service using a specified subcommand.
$ kubectl create service
-List all pods in ps output format.
+List all pods in ps output format
kubectl get pods
-List all pods in ps output format with more information (such as node name).
+List all pods in ps output format with more information (such as node name)
kubectl get pods -o wide
-List a single replication controller with specified NAME in ps output format.
+List a single replication controller with specified NAME in ps output format
kubectl get replicationcontroller web
-List deployments in JSON output format, in the "v1" version of the "apps" API group:
+List deployments in JSON output format, in the "v1" version of the "apps" API group
kubectl get deployments.v1.apps -o json
-List a single pod in JSON output format.
+List a single pod in JSON output format
kubectl get -o json pod web-pod-13je7
-List a pod identified by type and name specified in "pod.yaml" in JSON output format.
+List a pod identified by type and name specified in "pod.yaml" in JSON output format
kubectl get -f pod.yaml -o json
-List resources from a directory with kustomization.yaml - e.g. dir/kustomization.yaml.
+List resources from a directory with kustomization.yaml - e.g. dir/kustomization.yaml
kubectl get -k dir/
-Return only the phase value of the specified pod.
+Return only the phase value of the specified pod
kubectl get -o template pod/web-pod-13je7 --template={{.status.phase}}
-List resource information in custom columns.
+List resource information in custom columns
kubectl get pod test-pod -o custom-columns=CONTAINER:.spec.containers[0].name,IMAGE:.spec.containers[0].image
-List all replication controllers and services together in ps output format.
+List all replication controllers and services together in ps output format
kubectl get rc,services
-List one or more resources by their type and names.
+List one or more resources by their type and names
kubectl get rc/web service/frontend pods/web-pod-13je7
-Display one or many resources
+Display one or many resources.
Prints a table of the most important information about the specified resources. You can filter the list using a label selector and the --selector flag. If the desired resource type is namespaced you will only see results in your current namespace unless you pass --all-namespaces.
Uninitialized objects are not shown unless --include-uninitialized is passed.
By specifying the output as 'template' and providing a Go template as the value of the --template flag, you can filter the attributes of the fetched resources.
Use "kubectl api-resources" for a complete list of supported resources.
$ kubectl get [(-o|--output=)json|yaml|wide|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=...] (TYPE[.VERSION][.GROUP] [NAME | -l label] | TYPE[.VERSION][.GROUP]/NAME ...) [flags]
$ kubectl get [(-o|--output=)json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file|custom-columns-file|custom-columns|wide] (TYPE[.VERSION][.GROUP] [NAME | -l label] | TYPE[.VERSION][.GROUP]/NAME ...) [flags]
| output | o | - | Output format. One of: json|yaml|wide|name|custom-columns=...|custom-columns-file=...|go-template=...|go-template-file=...|jsonpath=...|jsonpath-file=... See custom columns [http://kubernetes.io/docs/user-guide/kubectl-overview/#custom-columns], golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [http://kubernetes.io/docs/user-guide/jsonpath]. | +Output format. One of: json|yaml|name|go-template|go-template-file|template|templatefile|jsonpath|jsonpath-as-json|jsonpath-file|custom-columns-file|custom-columns|wide See custom columns [https://kubernetes.io/docs/reference/kubectl/overview/#custom-columns], golang template [http://golang.org/pkg/text/template/#pkg-overview] and jsonpath template [https://kubernetes.io/docs/reference/kubectl/jsonpath/]. | |||
| output-watch-events | @@ -2447,47 +2441,47 @@ inspect them.Select all resources, including uninitialized ones, in the namespace of the specified resource types. | ||||||
| all-namespaces | +A | +false | +If true, check the specified action in all namespaces. | +||||
| allow-missing-template-keys | true | @@ -3685,17 +3685,17 @@ viewing your workloads in a Kubernetes cluster.Filename, directory, or URL to files identifying the resource to autoscale. | |||||
| generator | -- | horizontalpodautoscaler/v1 | -The name of the API generator to use. Currently there is only 1 generator. | -||||
| kustomize | k | @@ -3960,7 +3954,7 @@ viewing your workloads in a Kubernetes cluster. | |||||
| allow-id-changes | +as-current-user | false | -enable changes to a resourceId | +use the uid and gid of the command executor to run the function in the container | |||
| enable-alpha-plugins | @@ -4197,6 +4191,12 @@ viewing your workloads in a Kubernetes cluster.enable kustomize plugins | ||||||
| enable-helm | ++ | false | +Enable use of the Helm chart inflator generator. | +||||
| enable-managedby-label | false | @@ -4209,6 +4209,12 @@ viewing your workloads in a Kubernetes cluster.a list of environment variables to be used by functions | |||||
| helm-command | ++ | helm | +helm command (path to executable) | +||||
| load-restrictor | LoadRestrictionsRootOnly | @@ -4249,12 +4255,12 @@ viewing your workloads in a Kubernetes cluster.Select all resources, including uninitialized ones, in the namespace of the specified resource types | |||||
| all-namespaces | +A | +false | +If true, check the specified action in all namespaces. | +||||
| allow-missing-template-keys | true | @@ -4405,31 +4417,31 @@ viewing your workloads in a Kubernetes cluster.current-replicas | -1 | -Precondition for current size. Requires that the current size of the resource match this value in order to scale. | +Precondition for current size. Requires that the current size of the resource match this value in order to scale. -1 (default) for no condition. | ||
| dry-run | @@ -5274,7 +5286,7 @@ viewing your workloads in a Kubernetes cluster.
Configure application resources
+Configure application resources.
These commands help you make changes to existing application resources.
$ kubectl set SUBCOMMAND
List environment variable definitions in one or more pods, pod templates. Add, update, or remove container environment variable definitions in one or more pod templates (within replication controllers or deployment configurations). View or modify the environment variable definitions on all containers in the specified pods or pod templates, or just those that match a wildcard.
If "--env -" is passed, environment variables can be read from STDIN using the standard env syntax.
Possible resources include (case insensitive):
-pod (po), replicationcontroller (rc), deployment (deploy), daemonset (ds), job, replicaset (rs)
+pod (po), replicationcontroller (rc), deployment (deploy), daemonset (ds), statefulset (sts), cronjob (cj), replicaset (rs)
$ kubectl set env RESOURCE/NAME KEY_1=VAL_1 ... KEY_N=VAL_N
-Set a deployment's nginx container image to 'nginx:1.9.1', and its busybox container image to 'busybox'.
+Set a deployment's nginx container image to 'nginx:1.9.1', and its busybox container image to 'busybox'
kubectl set image deployment/nginx busybox=busybox nginx=nginx:1.9.1
@@ -5499,7 +5511,7 @@ viewing your workloads in a Kubernetes cluster.
Update existing container image(s) of resources.
Possible resources include (case insensitive):
-pod (po), replicationcontroller (rc), deployment (deploy), daemonset (ds), replicaset (rs)
+pod (po), replicationcontroller (rc), deployment (deploy), daemonset (ds), statefulset (sts), cronjob (cj), replicaset (rs)
$ kubectl set image (-f FILENAME | TYPE NAME) CONTAINER_NAME_1=CONTAINER_IMAGE_1 ... CONTAINER_NAME_N=CONTAINER_IMAGE_N
kubectl set resources -f path/to/file.yaml --limits=cpu=200m,memory=512Mi --local -o yaml
-Specify compute resource requirements (cpu, memory) for any resource that defines a pod template. If a pod is successfully scheduled, it is guaranteed the amount of resource requested, but may burst up to its specified limits.
-for each compute resource, if a limit is specified and a request is omitted, the request will default to the limit.
+Specify compute resource requirements (CPU, memory) for any resource that defines a pod template. If a pod is successfully scheduled, it is guaranteed the amount of resource requested, but may burst up to its specified limits.
+For each compute resource, if a limit is specified and a request is omitted, the request will default to the limit.
Possible resources include (case insensitive): Use "kubectl api-resources" for a complete list of supported resources..
$ kubectl set resources (-f FILENAME | TYPE NAME) ([--limits=LIMITS & --requests=REQUESTS]
-set the labels and selector before creating a deployment/service pair.
+Set the labels and selector before creating a deployment/service pair
kubectl create service clusterip my-svc --clusterip="None" -o yaml --dry-run=client | kubectl set selector --local -f - 'environment=qa' -o yaml | kubectl create -f -
kubectl create deployment my-dep -o yaml --dry-run=client | kubectl label --local -f - environment=qa -o yaml | kubectl create -f -
@@ -5829,16 +5841,16 @@ kubectl create deployment my-dep -o yaml --dry-run<
serviceaccount
- Set Deployment nginx-deployment's ServiceAccount to serviceaccount1
+ Set deployment nginx-deployment's service account to serviceaccount1
kubectl set serviceaccount deployment nginx-deployment serviceaccount1
- Print the result (in yaml format) of updated nginx deployment with serviceaccount from local file, without hitting apiserver
+ Print the result (in YAML format) of updated nginx deployment with the service account from local file, without hitting the API server
kubectl set sa -f nginx-deployment.yaml serviceaccount1 --local --dry-run=client -o yaml
-Update ServiceAccount of pod template resources.
+Update the service account of pod template resources.
Possible resources (case insensitive) can be:
replicationcontroller (rc), deployment (deploy), daemonset (ds), job, replicaset (rs), statefulset
Usage
@@ -5931,21 +5943,21 @@ kubectl create deployment my-dep -o yaml --dry-run<
subject
- Update a ClusterRoleBinding for serviceaccount1
+ Update a cluster role binding for serviceaccount1
kubectl set subject clusterrolebinding admin --serviceaccount=namespace:serviceaccount1
- Update a RoleBinding for user1, user2, and group1
+ Update a role binding for user1, user2, and group1
kubectl set subject rolebinding admin --user=user1 --user=user2 --group=group1
- Print the result (in yaml format) of updating rolebinding subjects from a local, without hitting the server
+ Print the result (in YAML format) of updating rolebinding subjects from a local, without hitting the server
kubectl create rolebinding admin --role=admin --user=admin -o yaml --dry-run=client | kubectl set subject --local -f - --user=foo -o yaml
-Update User, Group or ServiceAccount in a RoleBinding/ClusterRoleBinding.
+Update the user, group, or service account in a role binding or cluster role binding.
Usage
$ kubectl set subject (-f FILENAME | TYPE NAME) [--user=username] [--group=groupname] [--serviceaccount=namespace:serviceaccountname] [--dry-run=server|client|none]
Flags
@@ -6048,17 +6060,17 @@ kubectl create deployment my-dep -o yaml --dry-run<
wait
- Wait for the pod "busybox1" to contain the status condition of type "Ready".
+ Wait for the pod "busybox1" to contain the status condition of type "Ready"
kubectl wait --for=condition=Ready pod/busybox1
- The default value of status condition is true, you can set false.
+ The default value of status condition is true; you can set it to false
kubectl wait --for=condition=Ready=false pod/busybox1
- Wait for the pod "busybox1" to be deleted, with a timeout of 60s, after having issued the "delete" command.
+ Wait for the pod "busybox1" to be deleted, with a timeout of 60s, after having issued the "delete" command
kubectl delete pod/busybox1
kubectl wait --for=delete pod/busybox1 --timeout=60s
@@ -6066,7 +6078,7 @@ kubectl wait --for=delete pod/busybox1 Experimental: Wait for a specific condition on one or many resources.
The command takes multiple resources and waits until the specified condition is seen in the Status field of every given resource.
Alternatively, the command can wait for the given set of resources to be deleted by providing the "delete" keyword as the value to the --for flag.
- A successful message will be printed to stdout indicating when the specified condition has been met. One can use -o option to change to output destination.
+ A successful message will be printed to stdout indicating when the specified condition has been met. You can use -o option to change to output destination.
Usage
$ kubectl wait ([-f FILENAME] | resource.group/resource.name | resource.group [(-l label | --all)]) [--for=delete|--for condition=available]
Flags
@@ -6171,7 +6183,7 @@ applications.
attach
- Get output from running pod mypod, use the kubectl.kubernetes.io/default-container annotation # for selecting the container to be attached or the first container in the pod will be chosen
+ Get output from running pod mypod; use the 'kubectl.kubernetes.io/default-container' annotation # for selecting the container to be attached or the first container in the pod will be chosen
kubectl attach mypod
@@ -6181,12 +6193,12 @@ applications.
kubectl attach mypod -c ruby-container
- Switch to raw terminal mode, sends stdin to 'bash' in ruby-container from pod mypod # and sends stdout/stderr from 'bash' back to the client
+ Switch to raw terminal mode; sends stdin to 'bash' in ruby-container from pod mypod # and sends stdout/stderr from 'bash' back to the client
kubectl attach mypod -c ruby-container -i -t
- Get output from the first pod of a ReplicaSet named nginx
+ Get output from the first pod of a replica set named nginx
kubectl attach rs/nginx
@@ -6279,7 +6291,7 @@ applications.
kubectl auth can-i --list --namespace=foo
Check whether an action is allowed.
- VERB is a logical Kubernetes API verb like 'get', 'list', 'watch', 'delete', etc. TYPE is a Kubernetes resource. Shortcuts and groups will be resolved. NONRESOURCEURL is a partial URL starts with "/". NAME is the name of a particular Kubernetes resource.
+ VERB is a logical Kubernetes API verb like 'get', 'list', 'watch', 'delete', etc. TYPE is a Kubernetes resource. Shortcuts and groups will be resolved. NONRESOURCEURL is a partial URL that starts with "/". NAME is the name of a particular Kubernetes resource.
Usage
$ kubectl auth can-i VERB [TYPE | TYPE/NAME | NONRESOURCEURL]
Flags
@@ -6328,11 +6340,11 @@ applications.
reconcile
- Reconcile rbac resources from a file
+ Reconcile RBAC resources from a file
kubectl auth reconcile -f my-rbac-rules.yaml
-Reconciles rules for RBAC Role, RoleBinding, ClusterRole, and ClusterRoleBinding objects.
+Reconciles rules for RBAC role, role binding, cluster role, and cluster role binding objects.
Missing objects are created, and the containing namespace is created for namespaced objects, if required.
Existing roles are updated to include the permissions in the input objects, and remove extra permissions if --remove-extra-permissions is specified.
Existing bindings are updated to include the subjects in the input objects, and remove extra subjects if --remove-extra-subjects is specified.
@@ -6415,7 +6427,7 @@ applications.
cp
- !!!Important Note!!! # Requires that the 'tar' binary is present in your container # image. If 'tar' is not present, 'kubectl cp' will fail. # # For advanced use cases, such as symlinks, wildcard expansion or # file mode preservation consider using 'kubectl exec'. # Copy /tmp/foo local file to /tmp/bar in a remote pod in namespace
+ !!!Important Note!!! # Requires that the 'tar' binary is present in your container # image. If 'tar' is not present, 'kubectl cp' will fail. # # For advanced use cases, such as symlinks, wildcard expansion or # file mode preservation, consider using 'kubectl exec'. # Copy /tmp/foo local file to /tmp/bar in a remote pod in namespace
tar cf - /tmp/foo | kubectl exec -i -n <some-namespace> <some-pod> -- tar xf - -C /tmp/bar
@@ -6500,11 +6512,11 @@ applications.
kubectl describe po -l name=myLabel
- Describe all pods managed by the 'frontend' replication controller (rc-created pods # get the name of the rc as a prefix in the pod the name).
+ Describe all pods managed by the 'frontend' replication controller (rc-created pods # get the name of the rc as a prefix in the pod the name)
kubectl describe pods frontend
-Show details of a specific resource or group of resources
+Show details of a specific resource or group of resources.
Print a detailed description of the selected resources, including related resources such as events or controllers. You may select a single object by name, all objects of that type, provide a name prefix, or label selector. For example:
$ kubectl describe TYPE NAME_PREFIX
will first check for an exact match on TYPE and NAME_PREFIX. If no such resource exists, it will output details for every resource that has a name prefixed with NAME_PREFIX.
@@ -6529,6 +6541,12 @@ applications.
If present, list the requested object(s) across all namespaces. Namespace in current context is ignored even if specified with --namespace.
-Get output from running 'date' command from pod mypod, using the first container by default
+Get output from running the 'date' command from pod mypod, using the first container by default
kubectl exec mypod -- date
-Get output from running 'date' command in ruby-container from pod mypod
+Get output from running the 'date' command in ruby-container from pod mypod
kubectl exec mypod -c ruby-container -- date
-Switch to raw terminal mode, sends stdin to 'bash' in ruby-container from pod mypod # and sends stdout/stderr from 'bash' back to the client
+Switch to raw terminal mode; sends stdin to 'bash' in ruby-container from pod mypod # and sends stdout/stderr from 'bash' back to the client
kubectl exec mypod -c ruby-container -i -t -- bash -il
-List contents of /usr from the first container of pod mypod and sort by modification time. # If the command you want to execute in the pod has any flags in common (e.g. -i), # you must use two dashes (--) to separate your command's flags/arguments. # Also note, do not surround your command and its flags/arguments with quotes # unless that is how you would execute it normally (i.e., do ls -t /usr, not "ls -t /usr").
+List contents of /usr from the first container of pod mypod and sort by modification time # If the command you want to execute in the pod has any flags in common (e.g. -i), # you must use two dashes (--) to separate your command's flags/arguments # Also note, do not surround your command and its flags/arguments with quotes # unless that is how you would execute it normally (i.e., do ls -t /usr, not "ls -t /usr")
kubectl exec mypod -i -t -- ls -t /usr
@@ -6659,7 +6677,7 @@ applications.
-Return snapshot logs from all containers in pods defined by label app=nginx
kubectl logs -lapp=nginx --all-containers=true
+kubectl logs -l app=nginx --all-containers=true
Return snapshot of previous terminated ruby container logs from pod web-1
@@ -6674,7 +6692,7 @@ applications.
Begin streaming the logs from all containers in pods defined by label app=nginx
-kubectl logs -f -lapp=nginx --all-containers=true
+kubectl logs -f -l app=nginx --all-containers=true
Display only the most recent 20 lines of output in pod nginx
@@ -6844,9 +6862,9 @@ applications.
kubectl port-forward pod/mypod :5000
-Forward one or more local ports to a pod. This command requires the node to have 'socat' installed.
+Forward one or more local ports to a pod.
Use resource type/name such as deployment/mydeployment to select a pod. Resource type defaults to 'pod' if omitted.
- If there are multiple pods matching the criteria, a pod will be selected automatically. The forwarding session ends when the selected pod terminates, and rerun of the command is needed to resume forwarding.
+ If there are multiple pods matching the criteria, a pod will be selected automatically. The forwarding session ends when the selected pod terminates, and a rerun of the command is needed to resume forwarding.
Usage
$ kubectl port-forward TYPE/NAME [options] [LOCAL_PORT:]REMOTE_PORT [...[LOCAL_PORT_N:]REMOTE_PORT_N]
Flags
@@ -6877,36 +6895,36 @@ applications.
proxy
- To proxy all of the kubernetes api and nothing else.
+ To proxy all of the Kubernetes API and nothing else
kubectl proxy --api-prefix=/
- To proxy only part of the kubernetes api and also some static files. # You can get pods info with 'curl localhost:8001/api/v1/pods'
+ To proxy only part of the Kubernetes API and also some static files # You can get pods info with 'curl localhost:8001/api/v1/pods'
kubectl proxy --www=/my/files --www-prefix=/static/ --api-prefix=/api/
- To proxy the entire kubernetes api at a different root. # You can get pods info with 'curl localhost:8001/custom/api/v1/pods'
+ To proxy the entire Kubernetes API at a different root # You can get pods info with 'curl localhost:8001/custom/api/v1/pods'
kubectl proxy --api-prefix=/custom/
- Run a proxy to kubernetes apiserver on port 8011, serving static content from ./local/www/
+ Run a proxy to the Kubernetes API server on port 8011, serving static content from ./local/www/
kubectl proxy --port=8011 --www=./local/www/
- Run a proxy to kubernetes apiserver on an arbitrary local port. # The chosen port for the server will be output to stdout.
+ Run a proxy to the Kubernetes API server on an arbitrary local port # The chosen port for the server will be output to stdout
kubectl proxy --port=0
- Run a proxy to kubernetes apiserver, changing the api prefix to k8s-api # This makes e.g. the pods api available at localhost:8001/k8s-api/v1/pods/
+ Run a proxy to the Kubernetes API server, changing the API prefix to k8s-api # This makes e.g. the pods API available at localhost:8001/k8s-api/v1/pods/
kubectl proxy --api-prefix=/k8s-api
-Creates a proxy server or application-level gateway between localhost and the Kubernetes API Server. It also allows serving static content over specified HTTP path. All incoming data enters through one port and gets forwarded to the remote kubernetes API Server port, except for the path matching the static content path.
+Creates a proxy server or application-level gateway between localhost and the Kubernetes API server. It also allows serving static content over specified HTTP path. All incoming data enters through one port and gets forwarded to the remote Kubernetes API server port, except for the path matching the static content path.
Usage
$ kubectl proxy [--port=PORT] [--www=static-dir] [--www-prefix=prefix] [--api-prefix=prefix]
Flags
@@ -7013,7 +7031,7 @@ applications.
kubectl top node NODE_NAME
-Display Resource (CPU/Memory) usage of nodes.
+Display resource (CPU/memory) usage of nodes.
The top-node command allows you to see the resource consumption of nodes.
Usage
$ kubectl top node [NAME | -l label]
@@ -7049,8 +7067,8 @@ applications.
use-protocol-buffers
-false
-If present, protocol-buffers will be used to request metrics.
+true
+Enables using protocol-buffers to access Metrics API.
@@ -7076,7 +7094,7 @@ applications.
kubectl top pod -l name=myLabel
-Display Resource (CPU/Memory) usage of pods.
+Display resource (CPU/memory) usage of pods.
The 'top pod' command allows you to see the resource consumption of pods.
Due to the metrics pipeline delay, they may be unavailable for a few minutes since pod creation.
Usage
@@ -7105,6 +7123,12 @@ applications.
If present, print usage of containers within a pod.
kubectl api-versions
-Print the supported API versions on the server, in the form of "group/version"
+Print the supported API versions on the server, in the form of "group/version".
$ kubectl api-versions
$ kubectl certificate SUBCOMMAND
++Approve CSR 'csr-sqgzp'
+
kubectl certificate approve csr-sqgzp
+
Approve a certificate signing request.
kubectl certificate approve allows a cluster admin to approve a certificate signing request (CSR). This action tells a certificate signing controller to issue a certificate to the requestor with the attributes requested in the CSR.
SECURITY NOTICE: Depending on the requested attributes, the issued certificate can potentially grant a requester access to cluster resources or to authenticate as a requested identity. Before approving a CSR, ensure you understand what the signed certificate can do.
@@ -7216,6 +7245,11 @@ applications.++Deny CSR 'csr-sqgzp'
+
kubectl certificate deny csr-sqgzp
+
Deny a certificate signing request.
kubectl certificate deny allows a cluster admin to deny a certificate signing request (CSR). This action tells a certificate signing controller to not to issue a certificate to the requestor.
kubectl cluster-info
-Display addresses of the control plane and services with label kubernetes.io/cluster-service=true To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
+Display addresses of the control plane and services with label kubernetes.io/cluster-service=true. To further debug and diagnose cluster problems, use 'kubectl cluster-info dump'.
$ kubectl cluster-info
kubectl cluster-info dump --namespaces default,kube-system --output-directory=/path/to/cluster-state
-Dumps cluster info out suitable for debugging and diagnosing cluster problems. By default, dumps everything to stdout. You can optionally specify a directory with --output-directory. If you specify a directory, kubernetes will build a set of files in that directory. By default only dumps things in the 'kube-system' namespace, but you can switch to a different namespace with the --namespaces flag, or specify --all-namespaces to dump all namespaces.
-The command also dumps the logs of all of the pods in the cluster, these logs are dumped into different directories based on namespace and pod name.
+Dump cluster information out suitable for debugging and diagnosing cluster problems. By default, dumps everything to stdout. You can optionally specify a directory with --output-directory. If you specify a directory, Kubernetes will build a set of files in that directory. By default, only dumps things in the current namespace and 'kube-system' namespace, but you can switch to a different namespace with the --namespaces flag, or specify --all-namespaces to dump all namespaces.
+The command also dumps the logs of all of the pods in the cluster; these logs are dumped into different directories based on namespace and pod name.
$ kubectl cluster-info dump
-Mark node "foo" as unschedulable.
+Mark node "foo" as unschedulable
kubectl cordon foo
@@ -7416,20 +7450,20 @@ applications.
--Drain node "foo", even if there are pods not managed by a ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet on it.
+Drain node "foo", even if there are pods not managed by a replication controller, replica set, job, daemon set or stateful set on it
$ kubectl drain foo --force
+kubectl drain foo --force
- As above, but abort if there are pods not managed by a ReplicationController, ReplicaSet, Job, DaemonSet or StatefulSet, and use a grace period of 15 minutes.
+ As above, but abort if there are pods not managed by a replication controller, replica set, job, daemon set or stateful set, and use a grace period of 15 minutes
-$ kubectl drain foo --grace-period=900
+kubectl drain foo --grace-period=900
Drain node in preparation for maintenance.
- The given node will be marked unschedulable to prevent new pods from arriving. 'drain' evicts the pods if the APIServer supports http://kubernetes.io/docs/admin/disruptions/ . Otherwise, it will use normal DELETE to delete the pods. The 'drain' evicts or deletes all pods except mirror pods (which cannot be deleted through the API server). If there are DaemonSet-managed pods, drain will not proceed without --ignore-daemonsets, and regardless it will not delete any DaemonSet-managed pods, because those pods would be immediately replaced by the DaemonSet controller, which ignores unschedulable markings. If there are any pods that are neither mirror pods nor managed by ReplicationController, ReplicaSet, DaemonSet, StatefulSet or Job, then drain will not delete any pods unless you use --force. --force will also allow deletion to proceed if the managing resource of one or more pods is missing.
+ The given node will be marked unschedulable to prevent new pods from arriving. 'drain' evicts the pods if the API server supports https://kubernetes.io/docs/concepts/workloads/pods/disruptions/ . Otherwise, it will use normal DELETE to delete the pods. The 'drain' evicts or deletes all pods except mirror pods (which cannot be deleted through the API server). If there are daemon set-managed pods, drain will not proceed without --ignore-daemonsets, and regardless it will not delete any daemon set-managed pods, because those pods would be immediately replaced by the daemon set controller, which ignores unschedulable markings. If there are any pods that are neither mirror pods nor managed by a replication controller, replica set, daemon set, stateful set, or job, then drain will not delete any pods unless you use --force. --force will also allow deletion to proceed if the managing resource of one or more pods is missing.
'drain' waits for graceful termination. You should not operate on the machine until the command completes.
When you are ready to put the node back into service, use kubectl uncordon, which will make the node schedulable again.
- http://kubernetes.io/images/docs/kubectl_drain.svg
+ https://kubernetes.io/images/docs/kubectl_drain.svg
Usage
$ kubectl drain NODE
Flags
@@ -7444,6 +7478,12 @@ applications.
+chunk-size
+
+500
+Return large lists in chunks rather than all at once. Pass 0 to disable. This flag is beta and may change in the future.
+
+
delete-emptydir-data
false
@@ -7520,12 +7560,12 @@ applications.
taint
- Update node 'foo' with a taint with key 'dedicated' and value 'special-user' and effect 'NoSchedule'. # If a taint with that key and effect already exists, its value is replaced as specified.
+ Update node 'foo' with a taint with key 'dedicated' and value 'special-user' and effect 'NoSchedule' # If a taint with that key and effect already exists, its value is replaced as specified
kubectl taint nodes foo dedicated=special-user:NoSchedule
- Remove from node 'foo' the taint with key 'dedicated' and effect 'NoSchedule' if one exists.
+ Remove from node 'foo' the taint with key 'dedicated' and effect 'NoSchedule' if one exists
kubectl taint nodes foo dedicated:NoSchedule-
@@ -7548,7 +7588,7 @@ applications.
- A taint consists of a key, value, and effect. As an argument here, it is expressed as key=value:effect.
- The key must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to 253 characters.
-- Optionally, the key can begin with a DNS subdomain prefix and a single '/', like example.com/my-app
+- Optionally, the key can begin with a DNS subdomain prefix and a single '/', like example.com/my-app.
- The value is optional. If given, it must begin with a letter or number, and may contain letters, numbers, hyphens, dots, and underscores, up to 63 characters.
- The effect must be NoSchedule, PreferNoSchedule or NoExecute.
- Currently taint can only apply to node.
@@ -7631,9 +7671,9 @@ applications.
uncordon
- Mark node "foo" as schedulable.
+ Mark node "foo" as schedulable
-
$ kubectl uncordon foo
+kubectl uncordon foo
Mark node as schedulable.
Usage
@@ -7672,17 +7712,17 @@ applications.
api-resources
- Print the supported API Resources
+ Print the supported API resources
kubectl api-resources
- Print the supported API Resources with more information
+ Print the supported API resources with more information
kubectl api-resources -o wide
- Print the supported API Resources sorted by a column
+ Print the supported API resources sorted by a column
kubectl api-resources --sort-by=name
@@ -7697,11 +7737,11 @@ applications.
kubectl api-resources --namespaced=false
- Print the supported API Resources with specific APIGroup
+ Print the supported API resources with a specific APIGroup
kubectl api-resources --api-group=extensions
-Print the supported API resources on the server
+Print the supported API resources on the server.
Usage
$ kubectl api-resources
Flags
@@ -7772,12 +7812,12 @@ applications.
brew install bash-completion@2
- If kubectl is installed via homebrew, this should start working immediately. ## If you've installed via other means, you may need add the completion to your completion directory
+ If kubectl is installed via homebrew, this should start working immediately ## If you've installed via other means, you may need add the completion to your completion directory
kubectl completion bash > $(brew --prefix)/etc/bash_completion.d/kubectl
- Installing bash completion on Linux ## If bash-completion is not installed on Linux, please install the 'bash-completion' package ## via your distribution's package manager. ## Load the kubectl completion code for bash into the current shell
+ Installing bash completion on Linux ## If bash-completion is not installed on Linux, install the 'bash-completion' package ## via your distribution's package manager. ## Load the kubectl completion code for bash into the current shell
source <(kubectl completion bash)
@@ -7805,8 +7845,14 @@ source $HOME/.bash_profile
kubectl completion zsh > "${fpath[1]}/_kubectl"
Output shell completion code for the specified shell (bash or zsh). The shell code must be evaluated to provide interactive completion of kubectl commands. This can be done by sourcing it from the .bash_profile.
- Detailed instructions on how to do this are available here: https://kubernetes.io/docs/tasks/tools/install-kubectl/#enabling-shell-autocompletion
- Note for zsh users: [1] zsh completions are only supported in versions of zsh >= 5.2
+ Detailed instructions on how to do this are available here:
+ for macOS:
+ https://kubernetes.io/docs/tasks/tools/install-kubectl-macos/#enable-shell-autocompletion
+ for linux:
+ https://kubernetes.io/docs/tasks/tools/install-kubectl-linux/#enable-shell-autocompletion
+ for windows:
+ https://kubernetes.io/docs/tasks/tools/install-kubectl-windows/#enable-shell-autocompletion
+ Note for zsh users: [1] zsh completions are only supported in versions of zsh >= 5.2.
Usage
$ kubectl completion SHELL
@@ -7827,7 +7873,7 @@ source $HOME/.bash_profile
kubectl config current-context
-Displays the current-context
+Display the current-context.
Usage
$ kubectl config current-context
@@ -7837,7 +7883,7 @@ source $HOME/.bash_profile
kubectl config delete-cluster minikube
-Delete the specified cluster from the kubeconfig
+Delete the specified cluster from the kubeconfig.
Usage
$ kubectl config delete-cluster NAME
@@ -7847,7 +7893,7 @@ source $HOME/.bash_profile
kubectl config delete-context minikube
-Delete the specified context from the kubeconfig
+Delete the specified context from the kubeconfig.
Usage
$ kubectl config delete-context NAME
@@ -7857,13 +7903,13 @@ source $HOME/.bash_profile
kubectl config delete-user minikube
-Delete the specified user from the kubeconfig
+Delete the specified user from the kubeconfig.
Usage
$ kubectl config delete-user NAME
get-clusters
- List the clusters kubectl knows about
+ List the clusters that kubectl knows about
kubectl config get-clusters
@@ -7878,11 +7924,11 @@ source $HOME/.bash_profile
kubectl config get-contexts
- Describe one context in your kubeconfig file.
+ Describe one context in your kubeconfig file
kubectl config get-contexts my-context
-Displays one or many contexts from the kubeconfig file.
+Display one or many contexts from the kubeconfig file.
Usage
$ kubectl config get-contexts [(-o|--output=)name)]
Flags
@@ -7913,7 +7959,7 @@ source $HOME/.bash_profile
get-users
- List the users kubectl knows about
+ List the users that kubectl knows about
kubectl config get-users
@@ -7928,37 +7974,37 @@ source $HOME/.bash_profile
kubectl config rename-context old-name new-name
Renames a context from the kubeconfig file.
- CONTEXT_NAME is the context name that you wish to change.
- NEW_NAME is the new name you wish to set.
- Note: In case the context being renamed is the 'current-context', this field will also be updated.
+ CONTEXT_NAME is the context name that you want to change.
+ NEW_NAME is the new name you want to set.
+ Note: If the context being renamed is the 'current-context', this field will also be updated.
Usage
$ kubectl config rename-context CONTEXT_NAME NEW_NAME
set
- Set server field on the my-cluster cluster to https://1.2.3.4
+ Set the server field on the my-cluster cluster to https://1.2.3.4
kubectl config set clusters.my-cluster.server https://1.2.3.4
- Set certificate-authority-data field on the my-cluster cluster.
+ Set the certificate-authority-data field on the my-cluster cluster
kubectl config set clusters.my-cluster.certificate-authority-data $(echo "cert_data_here" | base64 -i -)
- Set cluster field in the my-context context to my-cluster.
+ Set the cluster field in the my-context context to my-cluster
kubectl config set contexts.my-context.cluster my-cluster
- Set client-key-data field in the cluster-admin user using --set-raw-bytes option.
+ Set the client-key-data field in the cluster-admin user using --set-raw-bytes option
kubectl config set users.cluster-admin.client-key-data cert_data_here --set-raw-bytes=true
-Sets an individual value in a kubeconfig file
+Set an individual value in a kubeconfig file.
PROPERTY_NAME is a dot delimited name where each token represents either an attribute name or a map key. Map keys may not contain dots.
- PROPERTY_VALUE is the new value you wish to set. Binary fields such as 'certificate-authority-data' expect a base64 encoded string unless the --set-raw-bytes flag is used.
- Specifying a attribute name that already exists will merge new fields on top of existing values.
+ PROPERTY_VALUE is the new value you want to set. Binary fields such as 'certificate-authority-data' expect a base64 encoded string unless the --set-raw-bytes flag is used.
+ Specifying an attribute name that already exists will merge new fields on top of existing values.
Usage
$ kubectl config set PROPERTY_NAME PROPERTY_VALUE
Flags
@@ -7983,7 +8029,7 @@ source $HOME/.bash_profile
set-cluster
- Set only the server field on the e2e cluster entry without touching other values.
+ Set only the server field on the e2e cluster entry without touching other values
kubectl config set-cluster e2e --server=https://1.2.3.4
@@ -8002,7 +8048,7 @@ source $HOME/.bash_profile
kubectl config set-cluster e2e --tls-server-name=my-cluster-name
-Sets a cluster entry in kubeconfig.
+Set a cluster entry in kubeconfig.
Specifying a name that already exists will merge new fields on top of existing values for those fields.
Usage
$ kubectl config set-cluster NAME [--server=server] [--certificate-authority=path/to/certificate/authority] [--insecure-skip-tls-verify=true] [--tls-server-name=example.com]
@@ -8032,7 +8078,7 @@ source $HOME/.bash_profile
kubectl config set-context gce --user=cluster-admin
-Sets a context entry in kubeconfig
+Set a context entry in kubeconfig.
Specifying a name that already exists will merge new fields on top of existing values for those fields.
Usage
$ kubectl config set-context [NAME | --current] [--cluster=cluster_nickname] [--user=user_nickname] [--namespace=namespace]
@@ -8058,7 +8104,7 @@ source $HOME/.bash_profile
set-credentials
- Set only the "client-key" field on the "cluster-admin" # entry, without touching other values:
+ Set only the "client-key" field on the "cluster-admin" # entry, without touching other values
kubectl config set-credentials cluster-admin --client-key=~/.kube/admin.key
@@ -8107,7 +8153,7 @@ source $HOME/.bash_profile
kubectl config set-credentials cluster-admin --exec-env=var-to-remove-
-Sets a user entry in kubeconfig
+Set a user entry in kubeconfig.
Specifying a name that already exists will merge new fields on top of existing values.
Client-certificate flags:
--client-certificate=certfile --client-key=keyfile
@@ -8176,16 +8222,16 @@ source $HOME/.bash_profile
unset
- Unset the current-context.
+ Unset the current-context
kubectl config unset current-context
- Unset namespace in foo context.
+ Unset namespace in foo context
kubectl config unset contexts.foo.namespace
-Unsets an individual value in a kubeconfig file
+Unset an individual value in a kubeconfig file.
PROPERTY_NAME is a dot delimited name where each token represents either an attribute name or a map key. Map keys may not contain dots.
Usage
$ kubectl config unset PROPERTY_NAME
@@ -8196,18 +8242,18 @@ source $HOME/.bash_profile
kubectl config use-context minikube
-Sets the current-context in a kubeconfig file
+Set the current-context in a kubeconfig file.
Usage
$ kubectl config use-context CONTEXT_NAME
view
- Show merged kubeconfig settings.
+ Show merged kubeconfig settings
kubectl config view
- Show merged kubeconfig settings and raw certificate data.
+ Show merged kubeconfig settings and raw certificate data
kubectl config view --raw
@@ -8293,7 +8339,7 @@ source $HOME/.bash_profile
kubectl explain pods.spec.containers
-List the fields for supported resources
+List the fields for supported resources.
This command describes the fields associated with each supported API resource. Fields are identified via a simple JSONPath identifier:
<type>.<fieldName>[.<fieldName>]
Add the --recursive flag to display all of the fields at once without descriptions. Information about each field is retrieved from the server in OpenAPI format.
@@ -8374,7 +8420,7 @@ source $HOME/.bash_profile
kubectl version
-Print the client and server version information for the current context
+Print the client and server version information for the current context.
Usage
$ kubectl version
Flags