Label and Selector
K8s Object | Set-based | Equality-based |
---|---|---|
Job | Yes | Yes |
Deployment | Yes | Yes |
Replicaset | Yes | Yes |
Daemonset | Yes | Yes |
NodeSelector | Yes | |
NodeAffinity | Yes | Yes |
NodeAntiAffinity | Yes | Yes |
kubectl command | Yes | Yes |
service | Yes |
Set based label selector
selector:
matchLabels:
component: redis
matchExpressions:
- {key: tier, operator: In, values: [cache]}
- {key: environment, operator: NotIn, values: [dev]}Equality based selector always support AND
to support OR, use set based selector
0 comments:
Post a Comment