Sitemap
KNNX Corp.

KNNX is a global leader in the development and deployment of innovative enterprise solutions using distributed ledger technology.

Kubernetes: Understanding Pod Affinity, Taint & Toleration

7 min readJun 22, 2022

--

Press enter or click to view image in full size

Hello readers, in one of my previous blogs on Kubernetes, we discussed Node Affinity and Node Selector and how they can be used to make pods scheduled on specific nodes. If you haven’t read it yet, I suggest going through it once to make things easier to understand and fill in the missing information.

In this blog, we will further discuss control over pod scheduling with the help of:

  • Inter-pod affinity and anti-affinity.
  • Taint and Toleration.

Prerequisite

You need a Kubernetes cluster if you want to follow along and be more hands-on.

Inter-pod affinity and anti-affinity

Just like node selectors and node affinity, pod definition uses labels assigned to nodes of the k8 cluster to decide which node that specific pod will land on.

Similarly, inter-pod affinity (or anti-affinity) is to be defined in the pod definition if you want to schedule (or avoid scheduling in case of anti-affinity) your pods on specific nodes. You can do it based on the labels of the pods already running/scheduled on the available cluster nodes.

Let us understand this with an example. Our initial setup has a cluster with two nodes (node01 and…

--

--

KNNX Corp.
KNNX Corp.

Published in KNNX Corp.

KNNX is a global leader in the development and deployment of innovative enterprise solutions using distributed ledger technology.

KNNX Corp.
KNNX Corp.

Written by KNNX Corp.

KNNX is a global leader in Distributed Ledger Technology and Enterprise Products. To learn more, head over to: https://www.knnx.com/

No responses yet