6
Equality-based Selectors Set-based Selectors
Operators:
= and ==
Examples:
environment = production
tier! = frontend
Commandline:
$kubectl get pods -l environment=production
In Manifest:
..
selector:
environment: production
tier: frontend
..
Operators:
in notin exists
Examples:
environment in (production, qa)
tier notin(frontend, backend)
Commandline:
$kubectl get pods -l `enviornment in(production)
In Manifest:
..
selector:
matchExpressions:
- {key:environment,operator:in,values:[prod,qa]}
- {key:tier,operator:Notin,values:[frontend,backend]}
..
Supports: Services, Replication Controller
Supports: Job, Deployment, ReplicaSet, DaemonSet