Show Menu
Cheatography

Kubernetes Cheat Sheet (DRAFT) by

Kubernetes Cheat Sheet

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Basics

kubectl run <ku­be>
Deploy an app on the cluster
kubectl cluste­r-info
view info about the cluster
kubectl get node
list all the nodes
kubectl create -f <fi­len­ame.ya­ml>
Create a resource from a file
kubectl apply -f <fi­len­ame.ya­ml>
Apply a config­uration to a resource by filename
kubectl replace -f <fi­len­ame.ya­ml>
Replace a config­uration to a resource by filename

Pods

kubectl run <po­dna­me> --image <image name>
creates a pod and set an image
kubectl get pods
shows pods in a cluster
kubectl describe pod <po­dna­me>
gives more details about specific pods
kube get pods -o wide
shows pods details .. its > get pods and < describe pod commands
kubectl delete pod <po­dna­me>
deletes a specific pod
 

ReplicaSet

kubectl get replicaset
Show replica sets in a cluster
kubectl edit replic­ase­ts.apps <re­pli­caset name>
Edit replica set inline
kubectl scale --repl­icas=6 -f replic­ase­t-d­efi­nit­ion.yml
scale replica set and update file
kubectl scale --repl­icas=6 -f replicaset myapp-­rep­licaset
scale replica set by type

Deployment