Kubernetes and Helm Troubleshooting Runbook
Basic Kubernetes Cluster Checks
# Check cluster context
kubectl config current-context
# List all contexts
kubectl config get-contexts
# Check node status
kubectl get nodes -o wide
# Describe a node
kubectl describe node <node-name>
Pods & Deployments
# List all pods in a namespace
kubectl get pods -n <namespace>
# List all resources in a namespace
kubectl get all -n <namespace>
# Describe a pod
kubectl describe pod <pod-name> -n <namespace>
# Get logs of a pod
kubectl logs <pod-name> -n <namespace>
# Logs of a specific container in a pod
kubectl logs <pod-name> -c <container-name> -n <namespace>
# Exec into a running container
kubectl exec -it <pod-name> -n <namespace> -- /bin/sh
Deployments, Services & Events
# Check deployment rollout status
kubectl rollout status deployment/<deployment-name> -n <namespace>
# Describe a service
kubectl describe svc <service-name> -n <namespace>
# Get cluster events
kubectl get events -n <namespace> --sort-by='.lastTimestamp'
# Check resource usage (if metrics-server is installed)
kubectl top pod -n <namespace>
kubectl top node
Helm Commands
# List all helm releases
helm list -A
# Get status of a helm release
helm status <release-name> -n <namespace>
# Get values of a helm release
helm get values <release-name> -n <namespace>
# Get all helm manifests (templates)
helm get manifest <release-name> -n <namespace>
# Upgrade a release with new values
helm upgrade <release-name> <chart> -f <values-file.yaml> -n <namespace>
# Uninstall a helm release
helm uninstall <release-name> -n <namespace>
# Dry run a Helm install/upgrade
helm upgrade --install <release-name> <chart> -f <values-file.yaml> --dry-run --debug -n <namespace>
Debugging Network/Ingress Issues
# Describe ingress
kubectl describe ingress <ingress-name> -n <namespace>
# Get all ingress objects
kubectl get ingress -A
# Check if service endpoints are correctly created
kubectl get endpoints <service-name> -n <namespace>
# Curl test from a pod
kubectl exec -it <pod-name> -n <namespace> -- curl <service-name>:<port>
# Get pod YAML
kubectl get pod <pod-name> -n <namespace> -o yaml
# Get deployment YAML
kubectl get deploy <deployment-name> -n <namespace> -o yaml
# Save to file
kubectl get svc <service-name> -n <namespace> -o yaml > service.yaml
Notes
- If a pod is stuck in CrashLoopBackOff, check:
kubectl describe pod
kubectl logs
- For DNS resolution issues inside pods:
kubectl exec -it <pod> -- nslookup <service>
- Always check resource limits (
requests, limits) if the pod is being OOMKilled.