Core Concepts Flashcards Preview

CKAD - Certified Kubernetes Application Developer > Core Concepts > Flashcards

Flashcards in Core Concepts Deck (19)
Loading flashcards...
1
Q

What is the imperative command to edit a pod?

e.g. a Pod named po1

A

kubectl edit po po1

2
Q

What is the apiVersion of ReplicaSet

A

apps/v1

3
Q

What is the purpose of ReplicaSet?

A

To maintain a stable set of replica Pods running at any given time.

4
Q

In the ReplicaSet spec, what are three required keys

A

template
replicas
selector

5
Q

What is the definition to match a label in a ReplicaSet selector?
(e.g. a label named foo with value bar)

A

selector:
matchLabels:
foo: bar

6
Q

What is the imperative command to scale a ReplicaSet?

e.g. a ReplicaSet named rs1 to 7 replicas

A

kubectl scale –replicas=7 rs rs1

7
Q

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)

A

kubectl scale –replicas=8 -f rs1.yaml

8
Q

What is the imperative command to retrieve a list of ReplicaSets?

A

kubectl get rs

9
Q

What is the imperative command to create a resource from a definition file?
(e.g. a definition file named def1.yaml)

A

kubectl apply -f def1.yaml

10
Q

What is the purpose of the Deployment resource?

A

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

11
Q

What is the apiVersion of Deployment?

A

apps/v1

12
Q

In the Deployment spec, what are three required keys?

A

template
replicas
selector
(same as replicaset)

13
Q

What is the imperative command to get all Deployments?

A

kubectl get deploy

14
Q

What is the purpose of a Namespace?

A

Kubernetes supports multiple virtual clusters backed by the same physical cluster. These virtual clusters are called namespaces.

15
Q

What is the imperative command to get all namespaces?

A

kubectl get ns

16
Q

What is the apiVersion of namespace?

A

v1

17
Q

What is the definition file for creating a namespace named ‘foo’?

A

apiVersion: v1
kind: Namespace
metadata:
name: foo

18
Q

What is the imperative command for creating a namespace

e.g. a Namespace named foo

A

kubectl create ns foo

19
Q

What is the imperative command to set the default namespace for the current context?
(e.g. a Namespace named foo)

A

kubectl config set-context $(kubectl config current-context) –namespace=foo