Difference between revisions of "Kubernetes selectors"
Jump to navigation
Jump to search
↑ https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/
Line 27: | Line 27: | ||
* [[Kubernetes field selectors]] | * [[Kubernetes field selectors]] | ||
* [[CKA v1.21: Understand how to use Labels, Selector and Annotations]] | * [[CKA v1.21: Understand how to use Labels, Selector and Annotations]] | ||
− | + | 0/2 nodes are available: 1 Too many pods, 1 nodes(s) [[didn't match Pod's node affinity/selector]] | |
== See also == | == See also == |
Revision as of 17:01, 4 January 2023
- https://kubernetes.io/docs/concepts/overview/working-with-objects/labels/
- https://kubernetes.io/docs/concepts/overview/working-with-objects/field-selectors/
kubectl get pods --selector=app=YOUR_APP
kubectl get pods --selector=app=YOUR_APP -o=jsonpath='{.items[0].metadata.name}'
kubectl get pods --field-selector status.phase=Running [1]
selector:
app=elasticsearch-master chart=elasticsearch release=elasticsearch-prod
spec: podSelector: matchLabels: app: elasticsearch-master
Related
kubectl set selector
- Kubernetes services
- Kubernetes field selectors
- CKA v1.21: Understand how to use Labels, Selector and Annotations
0/2 nodes are available: 1 Too many pods, 1 nodes(s) didn't match Pod's node affinity/selector
See also
- Kubernetes selectors,
PodSelector:, labelSelector:, spec.selector
- Kubernetes labels, selectors, recommended labels
,
kubectl label, kubectl annotate
, Common,kubernetes.io, app.kubernetes.io, MatchLabels:
,labels:
Advertising: