From 6b1e8eec1cd823c75ef8cb11aa9f110f64151fa1 Mon Sep 17 00:00:00 2001 From: Qiming Teng Date: Tue, 2 Jan 2018 17:35:03 +0800 Subject: [PATCH] Improve labels doc for nodeSelector Closes: #2559 --- .../overview/working-with-objects/labels.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/docs/concepts/overview/working-with-objects/labels.md b/docs/concepts/overview/working-with-objects/labels.md index b804f26d0f..e5853b920d 100644 --- a/docs/concepts/overview/working-with-objects/labels.md +++ b/docs/concepts/overview/working-with-objects/labels.md @@ -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