> For the complete documentation index, see [llms.txt](https://docs.ionos.com/cloud/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ionos.com/cloud/containers/managed-kubernetes/overview/taints-and-tolerations.md).

# Taints and Tolerations

Learn how taints and tolerations control pod scheduling on IONOS CLOUD Managed Kubernetes node pools, including taint components, effects, and system taints.

Taints allow you to repel pods from specific nodes. A node with a taint does not accept any pod that does not explicitly tolerate that taint. Tolerations are applied to pods and allow the scheduler to place those pods on tainted nodes. To add taints and tolerations, see [<mark style="color:blue;">Configure Taints and Tolerations</mark>](https://docs.ionos.com/cloud/containers/managed-kubernetes/how-tos/configure-node-pool-taints.md). To remove a taint, see [<mark style="color:blue;">Remove a Taint</mark>](https://docs.ionos.com/cloud/containers/managed-kubernetes/how-tos/remove-taint.md).

Use taints and tolerations together to:

* Reserve nodes for specific workloads, such as memory-heavy batch processing or high-priority services.
* Isolate nodes for compliance or security requirements.
* Control which workloads run on which node pools in your cluster.

## Understanding taints and tolerations

A taint has three components:

* **Key:** An identifier for the taint. Example: `workload`. A key consists of a name of up to 63 characters, with an optional prefix in domain name format of up to 253 characters, separated by `/`. Example: `example.com/my-taint`.
* **Value:** An optional label for the taint. Example: `high-memory`. It can be up to 63 characters long.
* **Effect:** What happens to pods that do not tolerate the taint. Required. Must be one of `NoSchedule`, `PreferNoSchedule`, or `NoExecute`.

A toleration matches a taint by key, value and effect. With the `Exists` operator, the value is not compared. In Managed Kubernetes, you set taints at the [<mark style="color:blue;">node pool level</mark>](https://docs.ionos.com/cloud/containers/managed-kubernetes/how-tos/management-of-node-pools.md#configure-advanced-settings). When you add a taint to a node pool, the taint is applied to all nodes in that pool. You can add up to **50 taints per node pool**. You can also apply taints to individual nodes directly using `kubectl`. See [<mark style="color:blue;">Apply a taint to an individual node</mark>](https://docs.ionos.com/cloud/containers/managed-kubernetes/how-tos/configure-node-pool-taints.md#apply-a-taint-to-an-individual-node).

## Taint effects

The effect of a taint determines how the scheduler treats pods without a matching toleration. The following table compares the three effects and their typical use cases:

| **Effect**         | **Behavior**                                                                                                                                                                                                                     | **Use case**                                                             |
| ------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------ |
| `NoSchedule`       | New pods without a matching toleration are not scheduled on this node. Running pods are not evicted, so they continue to run on the node.                                                                                        | Dedicated workload isolation                                             |
| `PreferNoSchedule` | The scheduler avoids placing pods without a matching toleration, but places them if no other nodes are available.                                                                                                                | Soft preference and non-critical separation                              |
| `NoExecute`        | New pods without a matching toleration are not scheduled. Running pods without a matching toleration are evicted immediately, which means they are stopped and removed from the node. Use `tolerationSeconds` to delay eviction. | Maintenance, node draining to move all pods off a node, strict isolation |

The following examples show a sample taint for each effect. Select the respective tab to view the scenario and the taint definition:

{% tabs %}
{% tab title="NoSchedule" %}
Reserve a node pool only for high-memory batch workloads. Pods without a matching `workload=batch:NoSchedule` toleration are not scheduled there. Managed Kubernetes system pods, such as `CoreDNS`, tolerate all `NoSchedule` and `NoExecute` taints and still run on these nodes. Existing pods on those nodes are not affected.

```json
{
  "key": "workload",
  "value": "batch",
  "effect": "NoSchedule"
}
```

{% endtab %}

{% tab title="PreferNoSchedule" %}
Soft-isolate a node pool for analytics jobs. Other pods avoid these nodes unless no other capacity is available. Analytics pods with a matching toleration can run there. To place them there, also add a `nodeSelector`.

```json
{
  "key": "workload",
  "value": "analytics",
  "effect": "PreferNoSchedule"
}
```

{% endtab %}

{% tab title="NoExecute" %}
Mark a node pool for scheduled maintenance. New pods are not scheduled, and running pods without a matching toleration are evicted. Pods with a `tolerationSeconds` value are given a grace period before eviction.

```json
{
  "key": "maintenance",
  "value": "scheduled",
  "effect": "NoExecute"
}
```

{% endtab %}
{% endtabs %}

## System taints

Kubernetes automatically applies the following taints based on node conditions. Manual action is not required.

| **Taint**                                       | **Applied when**                                 |
| ----------------------------------------------- | ------------------------------------------------ |
| `node.kubernetes.io/not-ready:NoExecute`        | The node is not in a `Ready` state.              |
| `node.kubernetes.io/unreachable:NoExecute`      | Kubernetes cannot reach the node.                |
| `node.kubernetes.io/memory-pressure:NoSchedule` | The node is running low on available memory.     |
| `node.kubernetes.io/disk-pressure:NoSchedule`   | The node is running low on available disk space. |

Kubernetes adds and removes these taints automatically when it detects a change in the node condition. Do not remove them manually.

## Next steps

* [<mark style="color:blue;">Configure Taints and Tolerations</mark>](https://docs.ionos.com/cloud/containers/managed-kubernetes/how-tos/configure-node-pool-taints.md)
* [<mark style="color:blue;">Remove a Taint</mark>](https://docs.ionos.com/cloud/containers/managed-kubernetes/how-tos/remove-taint.md)
* [<mark style="color:blue;">Kubernetes Documentation about Taints and Tolerations</mark>](https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.ionos.com/cloud/containers/managed-kubernetes/overview/taints-and-tolerations.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
