From 64500df1f861bb2a1183537e156cedf46f49be10 Mon Sep 17 00:00:00 2001 From: Bob Furu Date: Mon, 9 Dec 2019 12:41:47 -0500 Subject: [PATCH] Add proc for using tolerations on local-storage-operator pods --- .../persistent-storage-local-tolerations.adoc | 48 +++++++++++++++++++ .../persistent-storage-local.adoc | 2 + 2 files changed, 50 insertions(+) create mode 100644 modules/persistent-storage-local-tolerations.adoc diff --git a/modules/persistent-storage-local-tolerations.adoc b/modules/persistent-storage-local-tolerations.adoc new file mode 100644 index 000000000000..c857cbe3c5aa --- /dev/null +++ b/modules/persistent-storage-local-tolerations.adoc @@ -0,0 +1,48 @@ +// Module included in the following assemblies: +// +// storage/persistent-storage/persistent-storage-local.adoc + +[id="local-tolerations_{context}"] += Using tolerations with Local Storage Operator Pods + +Taints can be applied to nodes to prevent them from running general workloads. To allow the Local Storage Operator to use tainted nodes, you must add tolerations to the Pod or DaemonSet definition. This allows the created resources to run on these tainted nodes. + +You apply tolerations to the Local Storage Operator Pod through the LocalVolume resource +and apply taints to a node through the node specification. A taint on a node instructs the node to repel all Pods that do not tolerate the taint. Using a specific taint that is not on other Pods ensures that the Local Storage Operator Pod can also run on that node. + +[IMPORTANT] +==== +Taints and tolerations consist of a key, value, and effect. As an argument, it is expressed as `key=value:effect`. An operator allows you to leave one of these parameters empty. +==== + +.Prerequisites + +* The Local Storage Operator is installed. + +* Local disks are attached to {product-title} nodes with a taint. + +* Tainted nodes are expected to provision local storage. + +.Procedure +To configure local volumes for scheduling on tainted nodes: + +. Modify the YAML file that defines the Pod and add the `LocalVolume` spec, as shown in the following example: ++ +[source, yaml] +---- + apiVersion: "local.storage.openshift.io/v1" + kind: "LocalVolume" + metadata: + name: "local-disks" + namespace: "local-storage" + spec: + tolerations: + - key: localstorage <1> + operator: Equal <2> + value: "localstorage" <3> +---- +<1> Specify the key that you added to the node. +<2> Specify the `Equal` operator to require the `key`/`value` parameters to match. If operator is 'Exists`, the system checks that the key exists and ignores the value. If operator is `Equal`, then the key and value must match. +<3> Specify the value `local` of the tainted node. + +The defined tolerations will be passed to the resulting DaemonSets, allowing the diskmaker and provisioner Pods to be created for nodes that contain the specified taints. diff --git a/storage/persistent-storage/persistent-storage-local.adoc b/storage/persistent-storage/persistent-storage-local.adoc index 5405df20a79f..036e23bdbfc7 100644 --- a/storage/persistent-storage/persistent-storage-local.adoc +++ b/storage/persistent-storage/persistent-storage-local.adoc @@ -28,6 +28,8 @@ include::modules/persistent-storage-local-pvc.adoc[leveloffset=+1] include::modules/persistent-storage-local-pod.adoc[leveloffset=+1] +include::modules/persistent-storage-local-tolerations.adoc[leveloffset=+1] + == Deleting the Local Storage Operator's resources include::modules/persistent-storage-local-removing-devices.adoc[leveloffset=+2]