Cheatography
https://cheatography.com
Commands related to Kubernetes for Absolute Beginners - Udemy
This is a draft cheat sheet. It is a work in progress and is not finished yet.
kubectl
Kubectl Commands |
Pods |
ReplicationController |
Deployments |
kubectl run hello-minikube |
kubectl create -f pod-definition.yml |
kubectl create -f rc-definition.yml |
kubectl create -f deployment-definition.yml |
kubectl run nginx --image=nginx |
kubectl run redis --image=redis --dry-run=none -o yaml > dryrun-output.yaml |
ReplicaSet |
kubectl create deployment nginx --image=nginx |
kubectl cluster-info |
kubectl run redis --image=redis123 --dry-run -o yaml |
kubectl create -f replicaset-definition.yml |
kubectl get deployments |
kubectl get pods |
kubectl delete pods --all --namespace=default |
kubectl get replicaset |
kubectl get deploy |
kubectl get nodes |
kubectl apply -f nginx-changed.yaml |
kubectl get replicationcontroller |
kubectl get all |
kubectl get pods --show-labels |
|
kubectl get rs |
kubectl get namespace |
|
kubectl delete replicaset myapp-replicaset |
kubectl get pods -o wide |
|
Scale |
kubectl describe pod nginx |
|
kubectl replace -f replicaset-definition.yml |
|
|
kubectl scale --replicas=6 -f replicaset-definition.yml |
|
|
kubectl scale --replicas=6 replicaset myapp-replicaset |
|
|
Rollout & Services
Rollout |
Services |
kubectl apply -f deployment-definition.yml |
kubectl create -f service-definition.yml |
kubectl set image deployment/myapp-deployment nginx=nginx:1.9.1 |
kubectl get services |
kubectl rollout status deployment/myapp-deployment |
kubectl get svc |
kubectl rollout history deployment/myapp-deployment |
kubectl get nodes -o wide |
kubectl rollout undo deployment/myapp-deployment |
kubectl apply -f deployment-definition.yml --record |
ClusterIP |
kubectl create -f deployment-definition.yml --record |
kubectl create -f clusterip-defintion.yml |
|
kubectl get svc |
NameSpaces
kubectl create -f pod-definition.yaml –namespace=dev |
kubectl create -f namespace-dev.yaml |
kubectl create namespace dev |
kubectl config set-context $(kubectl config current-context) --namespace=dev |
kubectl get pods --all-namespaces |
kubectl create -f compute-quota.yaml |
kubectl get ns |
|
|
|