@@ -73,6 +73,25 @@ The former selects all resources with key equal to `environment` and value equal
|
|||||||
The latter selects all resources with key equal to `tier` and value distinct from `frontend`, and all resources with no labels with the `tier` key.
|
The latter selects all resources with key equal to `tier` and value distinct from `frontend`, and all resources with no labels with the `tier` key.
|
||||||
One could filter for resources in `production` excluding `frontend` using the comma operator: `environment=production,tier!=frontend`
|
One could filter for resources in `production` excluding `frontend` using the comma operator: `environment=production,tier!=frontend`
|
||||||
|
|
||||||
|
One usage scenario for equality-based label requirement is for Pods to specify
|
||||||
|
node selection criteria. For example, the sample Pod below selects nodes with
|
||||||
|
the label "`accelerator=nvidia-tesla-p100`".
|
||||||
|
|
||||||
|
```yaml
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Pod
|
||||||
|
metadata:
|
||||||
|
name: cuda-test
|
||||||
|
spec:
|
||||||
|
containers:
|
||||||
|
- name: cuda-test
|
||||||
|
image: "k8s.gcr.io/cuda-vector-add:v0.1"
|
||||||
|
resources:
|
||||||
|
limits:
|
||||||
|
nvidia.com/gpu: 1
|
||||||
|
nodeSelector:
|
||||||
|
accelerator: nvidia-tesla-p100
|
||||||
|
```
|
||||||
|
|
||||||
### _Set-based_ requirement
|
### _Set-based_ requirement
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user