kubectl reference
kubectl alpha Commands for features in alpha
kubectl alpha kuberc— Manage kuberc configuration fileskubectl alpha kuberc set— Set values in the kuberc configurationkubectl alpha kuberc view— Display the current kuberc configuration
kubectl annotate Update the annotations on a resource
kubectl api-resources Print the supported API resources on the server
kubectl api-versions Print the supported API versions on the server, in the form of "group/version"
kubectl apply Apply a configuration to a resource by file name or stdin
kubectl apply edit-last-applied— Edit latest last-applied-configuration annotations of a resource/objectkubectl apply set-last-applied— Set the last-applied-configuration annotation on a live object to match the contents of a filekubectl apply view-last-applied— View the latest last-applied-configuration annotations of a resource/object
kubectl attach Attach to a running container
kubectl auth Inspect authorization
kubectl auth can-i— Check whether an action is allowedkubectl auth reconcile— Reconciles rules for RBAC role, role binding, cluster role, and cluster role binding objectskubectl auth whoami— Experimental: Check self subject attributes
kubectl autoscale Auto-scale a deployment, replica set, stateful set, or replication controller
kubectl certificate Modify certificate resources
kubectl certificate approve— Approve a certificate signing requestkubectl certificate deny— Deny a certificate signing request
kubectl cluster-info Display cluster information
kubectl cluster-info dump— Dump relevant information for debugging and diagnosis
kubectl completion Output shell completion code for the specified shell (bash, zsh, fish, or powershell)
kubectl config Modify kubeconfig files
kubectl config current-context— Display the current-contextkubectl config delete-cluster— Delete the specified cluster from the kubeconfigkubectl config delete-context— Delete the specified context from the kubeconfigkubectl config delete-user— Delete the specified user from the kubeconfigkubectl config get-clusters— Display clusters defined in the kubeconfigkubectl config get-contexts— Describe one or many contextskubectl config get-users— Display users defined in the kubeconfigkubectl config rename-context— Rename a context from the kubeconfig filekubectl config set— Set an individual value in a kubeconfig filekubectl config set-cluster— Set a cluster entry in kubeconfigkubectl config set-context— Set a context entry in kubeconfigkubectl config set-credentials— Set a user entry in kubeconfigkubectl config unset— Unset an individual value in a kubeconfig filekubectl config use-context— Set the current-context in a kubeconfig filekubectl config view— Display merged kubeconfig settings or a specified kubeconfig file
kubectl cordon Mark node as unschedulable
kubectl cp Copy files and directories to and from containers
kubectl create Create a resource from a file or from stdin
kubectl create clusterrole— Create a cluster rolekubectl create clusterrolebinding— Create a cluster role binding for a particular cluster rolekubectl create configmap— Create a config map from a local file, directory or literal valuekubectl create cronjob— Create a cron job with the specified namekubectl create deployment— Create a deployment with the specified namekubectl create ingress— Create an ingress with the specified namekubectl create job— Create a job with the specified namekubectl create namespace— Create a namespace with the specified namekubectl create poddisruptionbudget— Create a pod disruption budget with the specified namekubectl create priorityclass— Create a priority class with the specified namekubectl create quota— Create a quota with the specified namekubectl create role— Create a role with single rulekubectl create rolebinding— Create a role binding for a particular role or cluster rolekubectl create secret— Create a secret using a specified subcommandkubectl create secret docker-registry— Create a secret for use with a Docker registrykubectl create secret generic— Create a secret from a local file, directory, or literal valuekubectl create secret tls— Create a TLS secretkubectl create service— Create a service using a specified subcommandkubectl create service clusterip— Create a ClusterIP servicekubectl create service externalname— Create an ExternalName servicekubectl create service loadbalancer— Create a LoadBalancer servicekubectl create service nodeport— Create a NodePort servicekubectl create serviceaccount— Create a service account with the specified namekubectl create token— Request a service account token
kubectl debug Create debugging sessions for troubleshooting workloads and nodes
kubectl delete Delete resources by file names, stdin, resources and names, or by resources and label selector
kubectl describe Show details of a specific resource or group of resources
kubectl diff Diff the live version against a would-be applied version
kubectl drain Drain node in preparation for maintenance
kubectl edit Edit a resource on the server
kubectl events List events
kubectl exec Execute a command in a container
kubectl explain Get documentation for a resource
kubectl expose Take a replication controller, service, deployment or pod and expose it as a new Kubernetes service
kubectl get Display one or many resources
kubectl kustomize Build a kustomization target from a directory or URL
kubectl label Update the labels on a resource
kubectl logs Print the logs for a container in a pod
kubectl options Print the list of flags inherited by all commands
kubectl patch Update fields of a resource
kubectl plugin Provides utilities for interacting with plugins
kubectl plugin list— List all visible plugin executables on a user's PATH
kubectl port-forward Forward one or more local ports to a pod
kubectl proxy Run a proxy to the Kubernetes API server
kubectl replace Replace a resource by file name or stdin
kubectl rollout Manage the rollout of a resource
kubectl rollout history— View rollout historykubectl rollout pause— Mark the provided resource as pausedkubectl rollout restart— Restart a resourcekubectl rollout resume— Resume a paused resourcekubectl rollout status— Show the status of the rolloutkubectl rollout undo— Undo a previous rollout
kubectl run Run a particular image on the cluster
kubectl scale Set a new size for a deployment, replica set, or replication controller
kubectl set Set specific features on objects
kubectl set env— Update environment variables on a pod templatekubectl set image— Update the image of a pod templatekubectl set resources— Update resource requests/limits on objects with pod templateskubectl set selector— Set the selector on a resourcekubectl set serviceaccount— Update the service account of a resourcekubectl set subject— Update the user, group, or service account in a role binding or cluster role binding
kubectl taint Update the taints on one or more nodes
kubectl top Display resource (CPU/memory) usage
kubectl top node— Display resource (CPU/memory) usage of nodeskubectl top pod— Display resource (CPU/memory) usage of pods