Kubernetes Commands Cheat Sheet Created by Gursimran Singh Cluster Management: - kubectl version: Show client and server version - kubectl config view: Show kubeconfig settings - kubectl cluster-info: Display cluster info Pods: - kubectl get pods: List pods in the current namespace - kubectl describe pod : Show details of a pod - kubectl logs : View logs from a pod - kubectl exec -it -- /bin/bash: Open shell inside a pod Deployments: - kubectl get deployments: List deployments - kubectl create -f : Create resource from config - kubectl apply -f : Apply changes to resource - kubectl rollout status deployment/: Check rollout status - kubectl scale deployment/ --replicas=: Scale deployment Services: - kubectl get services: List services - kubectl expose deployment --type=LoadBalancer --port=80: Expose deployment as service Namespaces: - kubectl get namespaces: List namespaces - kubectl create namespace : Create a new namespace - kubectl config set-context --current --namespace=: Set current namespace Other Useful Commands: - kubectl get nodes: List nodes in cluster - kubectl get events: Show cluster events - kubectl delete -f : Delete resource from config file - kubectl get all: List all resources in namespace