podAntiAffinity¶
Feature state: 1.0.0
podAntiAffinity
can prevent the scheduler from placing application replicas on the same node.
The value soft
means that the scheduler should prefer to not schedule two replica pods onto the same node but no guarantee is provided.
The value hard
means that the scheduler is required to not schedule two replica pods onto the same node.
The default value ""
will disable pod anti-affinity so that no anti-affinity rules will be configured.
Note
By default podAntiAffinity
is undefined.
Define podAntiAffinity
values.yaml | |
---|---|
In the above example three replicas of application would prefer to be scheduled on different Kubernetes nodes.
For more examples please see the Best practices linked below.
See also: