kubernetes affinity & anti-affinity

1/23/2020

I have some little confusion. Please clarify.

In kubernetes we have concept called affinity and anti-affinity.

affinity provided two types

1: node affinity

2: pod-affinity

I want to know what are types are provided by anti-affinity?

I am thinking like anti-affinity is providing the type called podAntiAffinity, is it correct, actually i have a document for this but having little doubt. Please clarify

-- kaka
affinity
kubernetes

1 Answer

1/23/2020

You have only podAntiAffinity. There is no nodeAntiAffinity and is not required. You can use NotIn or DoesNotExist operator with nodeAffinity to get behaviour similar to what you would expect if nodeAntiAffinity is available.

-- Shashank V
Source: StackOverflow