Kubernetes kubectl
kubernetes command line guide
Orchestrate containerized applications at scale. Inspect namespaces, nodes, pods, and configs.
Standard Commands Included
12 commands mappedkubectl get pods
Pods
List all active pods in the current namespace.
kubectl get pods -o wide
kubectl describe
Diagnostics
Show detailed status of a specific pod, service or deployment.
kubectl describe pod web-server
kubectl apply
Deployment
Apply or update a resource configuration from a YAML file.
kubectl apply -f deployment.yaml
kubectl logs
Diagnostics
Print the execution logs of a container inside a pod.
kubectl logs web-server
kubectl exec
Containers
Execute an interactive shell or single command inside a running pod container.
kubectl exec -it web-server -- sh
kubectl get svc
Services
List all exposed services and external endpoints in namespace.
kubectl get svc
kubectl delete
Deployment
Delete a resource by file name, dynamic label, ID, or namespace.
kubectl delete pod web-server
kubectl config
Setup
Manage kubectl configuration profiles and active clusters.
kubectl config view
kubectl get nodes
Setup
Inspect the hardware nodes forming the Kubernetes cluster.
kubectl get nodes
kubectl scale
Deployment
Scale deployment replica densities up or down dynamically.
kubectl scale --replicas=5 deployment/api-service
kubectl rollouts
Deployment
Manage rolling updates, revisions, or rollbacks of resources.
kubectl rollout undo deployment/api-service
kubectl create
Utility
Create a config map, secret, or resource schema template directly.
kubectl create secret generic api-key