pod-design Flashcards
Imperative command to update pod “nginx2”’s “app” label value to from “v1” to “v2”?
k label po nginx2 app=v2 –overwrite
Find pods with label “app=v1” and add assign additional label “tier=fe”
k label pods -l app=v1 tier=fe
Find pods with label “app=v1”, and show a table for them that includes the custom label “tier”.
k get pods -l app=v1 -L tier
For pods that have the label “app”, remove the that label.
k label po -l app app-
Assign label “foo=bar” to a node.
k label nodes minikube foo=bar
Remove the label “foo” from all nodes that have it.
k label nodes -l foo foo-
Create an nginx deployment with 2 replicas and open port 80
k create deployment nginx –image=nginx:1.18.0 –replicas=2 –port=80
Check the status of the rollout of deploy nginx.
k rollout status deployment nginx
How to rollback to a particular rollout?
k rollout undo deploy nginx –to-revision=4
Check the details of the 6th deployment revision.
k rollout history deployment nginx –revision=6
Scale a deployment to 5 replicas.
k scale deploy nginx –replicas=5
Autoscale a deployment to 80% CPU, min 5 and max 10
k autoscale deployment nginx –cpu-percent=80 –min=5 –max=10
How to pause the rollout of a deployment
k rollout pause deployment nginx