This is a draft cheat sheet. It is a work in progress and is not finished yet.
Basics
kubectl run <kube> |
Deploy an app on the cluster |
kubectl cluster-info |
view info about the cluster |
kubectl get node |
list all the nodes |
kubectl create -f <filename.yaml> |
Create a resource from a file |
kubectl apply -f <filename.yaml> |
Apply a configuration to a resource by filename |
kubectl replace -f <filename.yaml> |
Replace a configuration to a resource by filename |
Pods
kubectl run <podname> --image <image name> |
creates a pod and set an image |
kubectl get pods |
shows pods in a cluster |
kubectl describe pod <podname> |
gives more details about specific pods |
kube get pods -o wide |
shows pods details .. its > get pods and < describe pod commands |
kubectl delete pod <podname> |
deletes a specific pod |
|
|
ReplicaSet
kubectl get replicaset |
Show replica sets in a cluster |
kubectl edit replicasets.apps <replicaset name> |
Edit replica set inline |
kubectl scale --replicas=6 -f replicaset-definition.yml |
scale replica set and update file |
kubectl scale --replicas=6 -f replicaset myapp-replicaset |
scale replica set by type |
|
|
|