From 8c0be10bfd3e9e1e565a14a86ff93321f4ac4f7e Mon Sep 17 00:00:00 2001 From: Benjamin Fuller Date: Fri, 27 Sep 2019 14:33:35 -0600 Subject: [PATCH] Update docs to include example of tolerations in a pod (#16157) 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 3437960727350..7e95539ddfaf8 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"