Kubernetes35 commands
kubectl Cheat Sheet
Essential kubectl commands for managing Kubernetes clusters, pods, deployments, and services.
Cluster Info
| Command | Description |
|---|---|
| Display cluster info |
| List all nodes |
| List nodes with details |
| Show node resource usage |
| Detailed node info |
Pods
| Command | Description |
|---|---|
| List pods in current namespace |
| List pods in all namespaces |
| List pods with node info |
| Detailed pod info |
| View pod logs |
| Stream pod logs |
| Logs from specific container |
| Shell into a pod |
| Delete a pod |
| List running pods only |
Deployments
| Command | Description |
|---|---|
| List deployments |
| Deployment details |
| Scale a deployment |
| Check rollout status |
| Rollback deployment |
| View rollout history |
| Update container image |
Services & Networking
| Command | Description |
|---|---|
| List services |
| Expose deployment |
| List ingress resources |
| Port forward to service |
| List network policies |
Config & Secrets
| Command | Description |
|---|---|
| List ConfigMaps |
| List secrets |
| Create secret |
| Create ConfigMap from file |
Namespaces & Context
| Command | Description |
|---|---|
| List namespaces |
| List contexts |
| Switch context |
| Set default namespace |