Last active
January 25, 2023 16:36
-
-
Save Bivek/aec138466d41948ab458a32a2757992d to your computer and use it in GitHub Desktop.
K8S cheatsheet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alias k="kubectl" | |
kubectl get deploy | |
kubectl get services | |
kubectl get svc | |
kubectl create deployment nginx-deployment --image=nginx | |
kubectl get pods | |
kubectl expose deployment nginx-deployment --port=8080 --port-target=80 | |
kubectl get svc | |
minikube ip | |
ssh docker@<above-ip> (default password is tcuser) | |
kubectl scale deployment nginx-deployment --replicas=4 | |
kubectl get pods -0 wide | |
kubectl delete svc <service name> | |
kubectl expose deployment nginx-deployment --type=NodePort --port=8080 | |
kubectl get services | |
minikube ip | |
<minikube ip>:<port from kubectl get services> open in browser | |
minikube service <service name> | |
minikube service <service name> --url | |
kubectl expose deployment nginx-deployment --type=LoadBalancer --port=8080 | |
kubectl describe deployment nginx-deployment | |
kubectl set image deployment nginx-deployment <pod>=nginx:2.0.0 | |
kubectl rollout status deploy nginx-deployment | |
kubectl delete <pod name> | |
minikube dashboard | |
kubectl delete all -all | |
kubectl apply -f <yaml file> | |
kubectl delete -f <yaml file> | |
kubectl exec <pod> -- nslookup nginx |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment