﻿# Placing pods on nodes with restrictions

> [HTML Version](taints-tolerations.html)

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 On-Premises advanced settings](advanced-kubernetes-settings.md) 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 (\[OBJECT\]) and for the main application (\[OBJECT\]). Let's see how you can do it:

1. 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.

2. In the \[OBJECT\] field, configure tolerations, for example:

- for \[OBJECT\] pods in the \[OBJECT\] file:

````
global:  
  tolerations:  
  - key: "role"  
    operator: "Equal"  
    value: "monitoring"  
    effect: "NoSchedule"

- ````
for \[OBJECT\] pods in the \[OBJECT\] file:

````
global:  
  tolerations:  
  - key: "role"  
    operator: "Equal"  
    value: "brix"  
    effect: "NoSchedule"

````
Where:

- \[OBJECT\]. Taint name.

- \[OBJECT\]. Comparison operator:

	- \[OBJECT\]. A taint value for the node must match the value specified in the \[OBJECT\] parameter.

	- \[OBJECT\]. A taint with the added \[OBJECT\] must be specified in the node parameters. The \[OBJECT\] parameter is not considered.

- \[OBJECT\]. A taint value that is used with the \[OBJECT\] operator.

- \[OBJECT\]. A type of taint action:

	- \[OBJECT\]. A pod is only placed on a node with a taint if the corresponding toleration is configured for it.

	- \[OBJECT\]. 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.

	- \[OBJECT\]. 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 \[OBJECT\] taint, and BRIX pods will only be placed on nodes with the \[OBJECT\] taint.

## Default values for tolerations

By default, no values are set in the \[OBJECT\] 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.