You can control which nodes the Elasticsearch pods runs on and prevent
other workloads from using those nodes by using tolerations on the pods.
You apply tolerations to Elasticsearch pods through the
ClusterLogging custom resource (CR)
and apply taints to a node through the node specification. A taint on a node is a
key:value pair that
instructs the node to repel all pods that do not tolerate the taint. Using a specific
that is not on other pods ensures only Elasticsearch pods can run on that node.
By default, the Elasticsearch pods have the following toleration:
- effect: "NoExecute"
Use the following command to add a taint to a node where you want to schedule the cluster logging pods:
$ oc adm taint nodes <node-name> <key>=<value>:<effect>
$ oc adm taint nodes node1 elasticsearch=node:NoExecute
This example places a taint on
node1 that has key
node, and taint effect
Nodes with the
NoExecute effect schedule only pods that match the taint and remove existing pods
that do not match.
logstore section of the
ClusterLogging custom resource (CR) to configure a toleration for the Elasticsearch pods:
- key: "elasticsearch" (1)
operator: "Exists" (2)
effect: "NoExecute" (3)
tolerationSeconds: 6000 (4)
||Specify the key that you added to the node.
Exists operator to require a taint with the key
elasticsearch to be present on the Node.
||Optionally, specify the
tolerationSeconds parameter to set how long a pod can remain bound to a node before being evicted.
This toleration matches the taint created by the
oc adm taint command. A pod with this toleration could be scheduled onto