kubectl
Run commands against Kubernetes clusters. Some subcommands such as `run` have their own usage documentation.
More info →Subcommands (38)
Annotates Kubernetes resources.
Manage applications through files defining Kubernetes resources. Create and update resources in a cluster.
Attach to a process that is already running inside an existing container.
Inspect access permissions in a Kubernetes cluster.
Create an autoscaler to intelligently scale pod count based on kubernetes cluster demands.
Manage certificate signing requests.
Generate shell completion code for `kubectl` commands.
Manage Kubernetes configuration (kubeconfig) files for accessing clusters via `kubectl` or the Kubernetes API. By default, the Kubernetes will get its configuration from `${HOME}/.kube/config`. See also: `kubectx`, `kubens`.
Mark a node as unschedulable, preventing new pods from being assigned to it. See also: `kubectl uncordon`.
Copy files and directories between a local filesystem and a container in a pod.
Create a resource from a file or from `stdin`.
Debug cluster resources using interactive debugging containers.
Delete Kubernetes resources.
Show details of Kubernetes resources.
Check differences between live resources and files.
Drain a node in preparation for maintenance by marking it unschedulable and evicting all pods. See also: `kubectl cordon`, `kubectl uncordon`.
Edit Kubernetes resources.
Display resource events.
Execute a command in a container.
Display the documentation of a Kubernetes API resource, including available fields and descriptions.
Expose a resource as a new Kubernetes service.
Get Kubernetes objects and resources.
Build a set of Kubernetes resources using a `kustomization.yaml` file.
Label Kubernetes resources.
Show logs for containers in a pod.
Patch Kubernetes resources with new values.
Manage kubectl plugins that extend the functionality of the command.
Create a proxy server or application-level gateway between localhost and the Kubernetes API server.
Replace a resource by file or `stdin`.
Manage the rollout of a Kubernetes resource (deployments, daemonsets, and statefulsets).
Run pods in Kubernetes. Specifies pod generator to avoid deprecation error in some K8S versions.
Set a new size for a deployment, replica set, replication controller, or stateful set.
Update fields of existing application resources.
Update the taints on nodes.
See the resource consumption for nodes or pods.
Mark a node as schedulable, allowing new pods to be assigned to it. See also: `kubectl cordon`.
Print the client and server version information for the current context.
Wait for resource(s) to reach a certain state.
Options (1)
-o, --outputbooleanList information about a resource with more details
kubectl get {{pods|service|deployment|ingress|...}} {{[-o|--output]}} wideExamples (8)
List information about a resource with more details
kubectl get pods|service|deployment|ingress|... [-o|--output] wideUpdate specified pod with the label `unhealthy` and the value `true`
kubectl label pods name unhealthy=trueList all resources with different types
kubectl get allDisplay resource (CPU/Memory/Storage) usage of nodes or pods
kubectl top pods|nodesPrint the address of the master and cluster services
Display an explanation of a specific field
kubectl explain pods.spec.containersPrint the logs for a container in a pod or specified resource
kubectl logs pod_nameRun command in an existing pod
kubectl exec pod_name -- ls /