kubectl create deployment myapp --image=nginx
kubectl get deploy
kubectl describe deploy myapp
kubectl scale deploy myapp --replicas=5
Update / Set Image
kubectl set image deploy/myapp nginx=nginx:1.25
kubectl rollout status deploy/myapp
kubectl rollout history deploy/myapp
kubectl rollout undo deploy/myapp
kubectl get svc
kubectl describe svc myservice
kubectl delete svc myservice
kubectl expose deployment myapp --port=80 --type=NodePort
kubectl expose pod mypod --port=8080 --type=ClusterIP
kubectl get ns
kubectl create ns dev
kubectl delete ns dev
kubectl get pods -n dev
kubectl create configmap myconfig --from-literal=key=value
kubectl create configmap myconfig --from-file=config.json
kubectl get configmap
kubectl describe configmap myconfig
kubectl create secret generic db-secret --from-literal=password=12345
kubectl version
kubectl cluster-info
kubectl get nodes
kubectl describe node <node-name>
kubectl top node
kubectl apply -f pod.yaml
kubectl run mypod --image=nginx
kubectl get pods
kubectl get pod -o wide
kubectl get pod -A # all namespaces
kubectl describe pod <name>
kubectl logs <pod-name>
kubectl logs -f <pod-name> # live stream
kubectl logs <pod> -c <container>
kubectl exec -it <pod> -- bash
kubectl exec <pod> -- ls /app
kubectl delete pod <name>
kubectl delete -f pod.yaml
kubectl get ingress
kubectl describe ingress my-ingress
kubectl apply -f ingress.yaml
kubectl cordon <node>
kubectl drain <node>
kubectl uncordon <node>
kubectl get events
kubectl top nodes
kubectl top pods
kubectl describe pod <pod>
kubectl logs <pod>
kubectl exec -it <pod> -- sh
kubectl get events --sort-by=.metadata.creationTimestamp
kubectl debug <pod> -it --image=busybox
kubectl apply -f file.yaml
kubectl delete -f file.yaml
kubectl edit deploy myapp
kubectl port-forward pod/mypod 8080:80
kubectl port-forward svc/myservice 3000:80
kubectl autoscale deploy myapp --min=2 --max=10 --cpu-percent=70
kubectl get hpa
ubectl get pv
kubectl get pvc
kubectl describe pvc myclaim
kubectl apply -f .
kubectl delete -f .
kubectl get all
kubectl get all -n kube-system
Sign up to our newsletter to receive our latest news and products. Stay updated on the latest developments and special