When you want to reserve nodes for critical services and stop other tasks from running on those nodes, you can use taints and tolerations.
With these tools, you can tag nodes with taints and pods with tolerations. In this way, only pods for which you have specified tolerations will run on nodes with the specified taints.
Before configuring taints and tolerations, please read the BRIX Enterprise advanced settings article to learn about all the pod placement tools and recommendations for using them together.
How to configure taints and tolerations
Suppose, you need to split the workload between two groups of nodes: for monitoring (monitoring) and for the main application (brix). Let's see how you can do it:
- Add taints:
- on nodes dedicated to monitoring:
kubectl taint nodes node-1 role=monitoring:NoSchedule
- on nodes dedicated to BRIX:
kubectl taint nodes node-1 role=brix:NoSchedule
You can specify one node and multiple taints in the command by separating the taints labels with spaces.
- In the
.Values.global.tolerationsfield, configure tolerations, for example:
- for
monitoringpods in thevalues-monitoring.yamlfile:
global:
tolerations:
- key: "role"
operator: "Equal"
value: "monitoring"
effect: "NoSchedule"
- for
brixpods in thevalues-elma365.yamlfile:
global:
tolerations:
- key: "role"
operator: "Equal"
value: "brix"
effect: "NoSchedule"
Where:
key. Taint name.operator. Comparison operator:Equal. A taint value for the node must match the value specified in thevalueparameter.Exists. A taint with the addedkeymust be specified in the node parameters. Thevalueparameter is not considered.
value. A taint value that is used with theEqualoperator.effect. A type of taint action:NoSchedule. A pod is only placed on a node with a taint if the corresponding toleration is configured for it.PreferNoSchedule. It is preferred to schedule a pod only on those nodes with a taint for which toleration is configured. However, if there are no other nodes, the pod is scheduled on the node.NoExecute. The pod is not placed on a node with a given taint.
In this example, monitoring pods will only be placed on nodes with the role=monitoring taint, and BRIX pods will only be placed on nodes with the role=brix taint.
Default values for tolerations
By default, no values are set in the .Values.global.tolerations field. Therefore, tolerations are scheduled on any available nodes without considering taints. If you want to split the workload between different types of nodes, configure taints on the nodes and the corresponding tolerations in the pod configuration.
Found a typo? Select it and press Ctrl+Enter to send us feedback