Label and Selector




K8s ObjectSet-basedEquality-based 
JobYesYes
DeploymentYesYes
ReplicasetYesYes
DaemonsetYesYes
NodeSelectorYes
NodeAffinityYesYes
NodeAntiAffinityYesYes
kubectl commandYesYes
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