Orchestration: Kubernetes Flashcards
What to all install when installing K8s?
- kubectl
- K8s Master
- Worker node agents
How to run a pod using the soon to be deprecated method?
kubectl run mywebserver –image=nginx
How to exec into a pod?
kubectl exec -it mywebserver-xyz – bash
How to delete a pod?
kubectl delete pod mywebserver-xyz
What is an object?
Object is a record of intent, once created K8s will work to ensure that the object exists.
How to create a K8s object via YAML configuration file?
kubectl apply -f file.yaml
How to delete a K8s object via YAML configuration file?
kubectl delete -f file.yaml
What is a the purpose of a ReplicaSet?
To maintain a set of replica pods
What are the two states of pods in a ReplicaSet?
Current and Desired
How to view the labels of pods?
kubectl get pods –show-labels
What does the “selector / matchLabels” section do in ReplicaSets?
Determines which label is used to count the number of current pods for the ReplicaSet
What is the main difference between a ReplicaSet and a Deployment?
Deployment sits on top of ReplicaSets, with features like rolling out updates and rolling back.
How does a Deployment rollout changes?
Creates a new ReplicaSet, once running, deletes old ReplicaSet.
Equivalent K8s command for docker inspect?
kubectl describe resource_type resource_name
How to get the rollout history for a deployment?
kubectl rollout history deployment.v1.apps/my_deployment
How to get information about a specific deployment revision?
kubectl deployment history deployment.v1.apps/my_deployment –revision=1
What is the default max unavailable pods and maximum surge during a deployment rollout?
25%
For deployment rollout, which parameter determines the max number of pods that can be scheduled above the original number of pods?
maxSurge