POD Design - Labels, Selectors, Annotations Flashcards

1
Q

How can you select pods with a certain label?

A

kubectl get pods –selector app=App1,…

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

How do Kubernetes Objects use Labels and Selectors?

A
  • to connect objects internally
  • like ReplicaSet that controls pods with a certain label
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

For what are Annotations used and what are they?

A
  • used to record other data for information purposes
  • like buildVersion
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How do we define annotations?

A

With the metadata in a yaml.
Below name and labels
~~~
metadata:
name:
labels:
annotations:
buildVersion: 1.34
~~~

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

How can you search for multiple labels?

A

kubectl get pods -lapp=guestbook,role=replica

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

How can you count the numbers of result lines for a command?

A

kubectl get pods –selector env=dev –no-headers | wc -l

(wc = word count)

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