Improve labels doc for nodeSelector

Closes: #2559
This commit is contained in:
Qiming Teng
2018-01-02 17:35:03 +08:00
parent 53e05358be
commit 6b1e8eec1c
@@ -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.
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