From e8611fa29960bb63a8db32e863c65a395f828112 Mon Sep 17 00:00:00 2001 From: Benjamin Fuller Date: Fri, 30 Aug 2019 13:58:17 -0600 Subject: [PATCH] Update docs to include example of tolerations in a pod Co-Authored-By: Tim Bannister --- .../configuration/taint-and-toleration.md | 4 ++++ content/en/examples/pods/pod-with-toleration.yaml | 15 +++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 content/en/examples/pods/pod-with-toleration.yaml diff --git a/content/en/docs/concepts/configuration/taint-and-toleration.md b/content/en/docs/concepts/configuration/taint-and-toleration.md index 8757386c1012a..54e78b84a2894 100644 --- a/content/en/docs/concepts/configuration/taint-and-toleration.md +++ b/content/en/docs/concepts/configuration/taint-and-toleration.md @@ -61,6 +61,10 @@ tolerations: effect: "NoSchedule" ``` +Here’s an example of a pod that uses tolerations: + +{{< codenew file="pods/pod-with-toleration.yaml" >}} + A toleration "matches" a taint if the keys are the same and the effects are the same, and: * the `operator` is `Exists` (in which case no `value` should be specified), or diff --git a/content/en/examples/pods/pod-with-toleration.yaml b/content/en/examples/pods/pod-with-toleration.yaml new file mode 100644 index 0000000000000..79f2756a8ce5f --- /dev/null +++ b/content/en/examples/pods/pod-with-toleration.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Pod +metadata: + name: nginx + labels: + env: test +spec: + containers: + - name: nginx + image: nginx + imagePullPolicy: IfNotPresent + tolerations: + - key: "example-key" + operator: "Exists" + effect: "NoSchedule"