Core Concepts Flashcards
What is the imperative command to edit a pod?
e.g. a Pod named po1
kubectl edit po po1
What is the apiVersion of ReplicaSet
apps/v1
What is the purpose of ReplicaSet?
To maintain a stable set of replica Pods running at any given time.
In the ReplicaSet spec, what are three required keys
template
replicas
selector
What is the definition to match a label in a ReplicaSet selector?
(e.g. a label named foo with value bar)
selector:
matchLabels:
foo: bar
What is the imperative command to scale a ReplicaSet?
e.g. a ReplicaSet named rs1 to 7 replicas
kubectl scale –replicas=7 rs rs1
What is the imperative command to scale a ReplicaSet based on a definition file?
(e.g. a definition file named rs1.yaml, scaled to 8 replicas)
kubectl scale –replicas=8 -f rs1.yaml
What is the imperative command to retrieve a list of ReplicaSets?
kubectl get rs
What is the imperative command to create a resource from a definition file?
(e.g. a definition file named def1.yaml)
kubectl apply -f def1.yaml
What is the purpose of the Deployment resource?
A Deployment provides declarative updates for Pods and ReplicaSets.
The Deployment Controller changes the actual state to the desired state (described by the deployment definition) at a controlled rate
What is the apiVersion of Deployment?
apps/v1
In the Deployment spec, what are three required keys?
template
replicas
selector
(same as replicaset)
What is the imperative command to get all Deployments in your cluster ?
kubectl get deploy -A
What is the purpose of a Namespace?
Kubernetes supports multiple virtual clusters backed by the same physical cluster. These virtual clusters are called namespaces.
What is the imperative command to get all namespaces?
kubectl get ns