Pods, ReplicaSet, Deployments Flashcards

1
Q

What format of file does Kubernetes use as input for the creation of objects as pod, deployments, services etc?

A

YAML files

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

What are the 4 top level or root level properties of a Kubernetes definition YAML files? These are also the required fields?

A

apiVersion:
kind:
metadata:
spec:

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

What is apiVersion in Kubernetes definition YAML files?

A

Version of the Kubernetes API used to create the object.
eg. v1, apps/v1beta
apiVersion is a single value

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

What is kind property in Kubernetes definition YAML files?

A

kind refers to the type of object we want to create.
eg. POD, ReplicaSet, Service
kind is also a single value

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

What is metadata in Kubernetes definition YAML files?

A

metadata is the data about the object, like name, label etc. This in the form of a dictionary. names and labels are children of metadata.
metadata is a dictionary

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

Can you tell about name and label inside metadata property of a Kubernetes definition YAML file?

A

name is a single value
label is again a dictionary within the metadata dictionary. It can have any key:value pair as you desire

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

what are labels in metadata used for?

A

label is like a custom dictionary, where you can add name for your app or any custom key:value pair for that object

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

what is spec property in in Kubernetes definition YAML files used for?

A

Used to provide additional details pertaining to that object including details such as the container image.
spec is a dictionary that contains a list of containers which in turn is a dictionary which contains key value pairs like
spec:
containers:
- name: name of the container
image: image of that container

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

Command to create pod using YAML definition file?

A

kubectl create -f pod-definition.yml

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

How to see detailed information about a pod?

A

kubectl describe pod myapp-pod

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

Which command to create a pod?

A

kubectl apply
or
kubectl create
Both of these can be used

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

How to specify the pod definition file when creating a pod?

A

kubectl apply -f pod.yaml
or
kubectl create -f pod.yaml

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

Command to check the status of the pod?

A

kubectl get pods
kubectl describe pod nginx

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

Create a pod definition file for creating nginx pod with some labels and image specified?

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