POD Design - Labels, Selectors, Annotations Flashcards
1
Q
How can you select pods with a certain label?
A
kubectl get pods –selector app=App1,…
2
Q
How do Kubernetes Objects use Labels and Selectors?
A
- to connect objects internally
- like ReplicaSet that controls pods with a certain label
3
Q
For what are Annotations used and what are they?
A
- used to record other data for information purposes
- like buildVersion
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
~~~
5
Q
How can you search for multiple labels?
A
kubectl get pods -lapp=guestbook,role=replica
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)
7
Q
A