Labels Flashcards

1
Q

How do you get all pods that have a color label set to red?

A

kubectl get pods –selector=”color=red”

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

How do you get all pods that have the labels color and shape set to red and ball?

A

kubectl get pods –selector=”color=red,shape=ball”

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

How do you get all pods that have the label color, no matter the value?

A

kubectl get pods –selector=”color”

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

How do you get all pods that have the label color set to red or blue?

A

kubectl get pods –selector=”color in (red, blue)”

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

Give examples of use cases for annotations?

A

To track rollout status in rolling deployments. Add pointers to logging urls and other links.

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

If no prefix is used in a label, can every user see the label?

A

No, only labels with prefixes can be seen by other users (Needs to be tested)

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

What are field selectors?

A

Field selectors are another way of filtering resources by looking into the resources fields. For example “kubectl get pods –field-selector “metadata.name=pod-name”

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