Core Concepts Flashcards

1
Q

What is the imperative command to edit a pod?

e.g. a Pod named po1

A

kubectl edit po po1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the apiVersion of ReplicaSet

A

apps/v1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the purpose of ReplicaSet?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

In the ReplicaSet spec, what are three required keys

A

template
replicas
selector

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

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

A

kubectl get rs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the apiVersion of Deployment?

A

apps/v1

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

In the Deployment spec, what are three required keys?

A

template
replicas
selector
(same as replicaset)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the imperative command to get all Deployments?

A

kubectl get deploy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What is the imperative command to get all namespaces?

A

kubectl get ns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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