---
source: https://iinventedlight.com/library/notes/kubernetes-taints-tolerations.md
title: "Taints let a node repel Pods; tolerations let matching Pods schedule there"
license: CC-BY-4.0
license_url: https://creativecommons.org/licenses/by/4.0/
source_license: "CC-BY-4.0 (Kubernetes docs); CC-BY-4.0 (kubernetes/website (GitHub)); prose restates cited source lines in own words"
license_family: mixed-green
attribution: "Summary by iinventedlight (AI-assisted). Sources: Kubernetes docs, Taints and Tolerations; kubernetes/website (GitHub), Assigning Pods to Nodes (source page). CC-BY-4.0 (https://raw.githubusercontent.com/kubernetes/website/main/LICENSE). Copyright The Kubernetes Authors."
author: "iinventedlight (synthesis of cited sources); text drafted with AI assistance"
date: 2026-11-18
status: published
approved_by: "Cole Withington, 2026-11-20 13:14 PT: \"Publish the full batch and rewrite the 6 live notes\""
checked_on: 2026-11-18
as_of: 2026-11-18
confidence: medium
untested: "Not reproduced (2026-11-18). Official docs and source files were read; no test suite, server, or API call was run for this note."
category: coding-references
topic_area: "code-devops: Kubernetes taints and tolerations"
tags: [kubernetes, taints, tolerations, scheduling, NoSchedule, NoExecute]
client: Librarian
sources:
  - id: S1
    title: "Taints and Tolerations"
    publisher: Kubernetes docs
    url: https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/
    accessed: 2026-11-18
    license: "CC-BY-4.0"
  - id: S2
    title: "Assigning Pods to Nodes (source page)"
    publisher: kubernetes/website (GitHub)
    url: https://github.com/kubernetes/website/blob/main/content/en/docs/concepts/scheduling-eviction/assign-pod-node.md
    accessed: 2026-11-18
    license: "CC-BY-4.0"
---
# Taints let a node repel Pods; tolerations let matching Pods schedule there
**Answer:** Node affinity attracts Pods to nodes; taints are the opposite and allow a node to repel a set of pods. Tolerations are applied to pods and allow the scheduler to schedule pods with matching taints, but they don't guarantee scheduling.

## Add and remove a taint

```shell
kubectl taint nodes node1 key1=value1:NoSchedule
kubectl taint nodes node1 key1=value1:NoSchedule-
```

The first command places a taint with key `key1`, value `value1` and effect `NoSchedule` on node1, so a pod without a matching toleration cannot schedule onto node1. To remove the taint, run the same command with a trailing `-`.

## Matching toleration

```yaml
tolerations:
- key: "key1"
  operator: "Equal"
  value: "value1"
  effect: "NoSchedule"
```

Use `operator: "Exists"` with the same key and effect to match any value.

## Effects

- `NoSchedule`: new pods without a matching toleration are not scheduled onto the node.
- `PreferNoSchedule`: a "preference" or "soft" version of NoSchedule.
- `NoExecute`: also affects pods already running on the node; pods that do not tolerate it are evicted. A toleration can set `tolerationSeconds` to dictate how long the pod stays bound after the taint is added.

## Gotcha

If you manually specify `.spec.nodeName`, that bypasses the scheduler, and the Pod is bound to the node even if it has NoSchedule taints.

## See also

- [kubernetes-pods](https://iinventedlight.com/library/notes/kubernetes-pods/)
- [kubernetes-daemonsets](https://iinventedlight.com/library/notes/kubernetes-daemonsets/)
- [kubernetes-labels-selectors](https://iinventedlight.com/library/notes/kubernetes-labels-selectors/)

## Claims

- id: C1
  claim: Taints allow a node to repel a set of pods.
  source: S1
  evidence: "they allow a node to repel a set of pods"

- id: C2
  claim: Tolerations allow scheduling but do not guarantee it.
  source: S1
  evidence: "Tolerations allow scheduling but don't guarantee scheduling"

- id: C3
  claim: Setting nodeName bypasses the scheduler.
  source: S1
  evidence: "that action bypasses the scheduler"

- id: C4
  claim: Node taints can repel Pods from specific nodes.
  source: S2
  evidence: "to repel Pods from specific nodes"

## Sources

- [S1] Taints and Tolerations. Kubernetes docs. https://kubernetes.io/docs/concepts/scheduling-eviction/taint-and-toleration/ . License: CC-BY-4.0. Accessed 2026-11-18.

- [S2] Assigning Pods to Nodes (source page). kubernetes/website (GitHub). https://github.com/kubernetes/website/blob/main/content/en/docs/concepts/scheduling-eviction/assign-pod-node.md . License: CC-BY-4.0. Accessed 2026-11-18.

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Kubernetes docs, Taints and Tolerations; kubernetes/website (GitHub), Assigning Pods to Nodes (source page). CC-BY-4.0 (https://raw.githubusercontent.com/kubernetes/website/main/LICENSE). Copyright The Kubernetes Authors. Text was condensed and changed from the originals.

---

Agents: [/agents.md](/agents.md) | [/.well-known/agent-library.json](/.well-known/agent-library.json).
