Loading tool…
cheatsheet
kubectl get podsList all pods in the current namespace
kubectl get nodesList all cluster nodes
kubectl describe pod my-podShow detailed info about a pod
kubectl logs my-podFetch logs of a pod
kubectl exec -it my-pod -- bashExecute a shell in a running pod
kubectl apply -f my-deployment.yamlCreate/update resources from a YAML file
kubectl delete -f my-deployment.yamlDelete resources from a YAML file
kubectl get deploymentsList all deployments
kubectl expose deployment my-app --port=80 --target-port=8080 --type=NodePortExpose a deployment as a service
kubectl scale deployment my-app --replicas=3Scale a deployment to 3 replicas
kubectl rollout status deployment/my-appCheck status of a deployment rollout
kubectl rollout undo deployment/my-appRollback to the previous deployment
kubectl config get-contextsList available kubectl contexts
kubectl config use-context my-clusterSwitch to a different cluster context
kubectl get namespacesList all namespaces
kubectl create namespace devCreate a new namespace
kubectl config set-context --current --namespace=devSet default namespace for current context
kubectl get configmapsList config maps
kubectl get secretsList secrets
kubectl create configmap my-config --from-literal=key=valueCreate a config map from literal
kubectl create secret generic my-secret --from-literal=username=adminCreate a generic secret
Get new cheatsheets & tools in your inbox
No spam — just new releases, occasionally.