Skip to content

Kubernetes & Helm Cheat Sheet

Terminal window
kubectl get nodes # List all nodes
kubectl get nodes -o wide # List nodes with detailed info
kubectl get pods # List all pods
kubectl get pods -w # Watch pod status
kubectl get deploy # List deployments
kubectl get service # List services
kubectl get ing # List ingresses
kubectl describe pod <POD> # Show detailed info for a pod
kubectl describe ing <ING> # Show detailed info for ingress
kubectl delete pod <POD> # Delete a pod
kubectl edit deploy <DEPLOY> # Edit deployment configuration
kubectl edit service <SVC> # Edit service configuration
kubectl get pvc # List persistent volume claims
kubectl get all -n <NAMESPACE> # Get all resources in a namespace
Terminal window
export POD_NAME=$(kubectl get pods --namespace default -l "app.kubernetes.io/name=<APP>,app.kubernetes.io/instance=<INSTANCE>" -o jsonpath="{.items[0].metadata.name}")
export CONTAINER_PORT=$(kubectl get pod --namespace default $POD_NAME -o jsonpath="{.spec.containers[0].ports[0].containerPort}")
kubectl --namespace default port-forward $POD_NAME 8080:$CONTAINER_PORT
# Access app at http://127.0.0.1:8080
Terminal window
helm --version # Check Helm version
helm help # Helm CLI help
helm search repo <CHART> # Search installed repos for a chart
helm search hub <CHART> # Search Helm Hub
helm repo add <NAME> <URL> # Add a Helm repository
helm repo update # Update repo indexes
helm install <RELEASE> <CHART> [options] # Install a chart
helm upgrade <RELEASE> <CHART> --values <FILE> # Upgrade chart with custom values
helm uninstall <RELEASE> <CHART> [options] # Uninstall a chart (Not recommended.)
helm show values <CHART> > values.yml # Export default chart values for editing

Note: Try fixing any issues via ‘helm upgrade’ instead of uninstalling and installing again, since this might recreate things you want to keep the same.

Terminal window
# Add repos
helm repo add community-charts https://community-charts.github.io/helm-charts
helm repo add traefik https://traefik.github.io/charts
helm repo add secustor https://secustor.dev/helm-charts
helm repo update
# Install applications
helm install n8n community-charts/n8n
helm install traefik traefik/traefik
helm install imchlc secustor/immich -n immich --create-namespace
# Upgrade applications with custom values
helm show values community-charts/n8n > n8n-values.yml
helm upgrade n8n community-charts/n8n --values n8n-values.yml
helm upgrade immich secustor/immich -n immich --values immich-values.yml
# Uninstall
helm uninstall n8n community-charts/n8n
Terminal window
kubectl logs <POD> [-c <CONTAINER>] [--previous] # View logs
kubectl get pods -w # Watch pod status
kubectl describe pod <POD> # Debug pod events
nslookup <HOSTNAME> # DNS resolution check
Terminal window
ip route # Show routing table
route list # Alternative routing info
  • Use namespaces for multi-app environments.
  • Port-forwarding is useful for local testing before exposing ingress.
  • Always check logs and describe pods when troubleshooting.
  • Helm values.yml allows for customization of deployments.