Skip to content

podAntiAffinityTopologyKey

Feature state: 1.0.0

podAntiAffinityToplologyKey sets the TopologyKey to use for automatic podAntiAffinity rules.

Note

By default podAntiAffinityTopologyKey is set to kubernetes.io/hostname.

Define podAntiAffinity with zone toplogy key

values.yaml
1
2
3
4
5
6
7
8
9
nameOverride: my-app
image:
  repository: nginx
  tag: latest

replicaCount: 3

podAntiAffinity: "soft"
podAntiAffinityTopologyKey: kubernetes.io/zone
Deploy command
helm install webapp sysbee/kubedeploy -f values.yaml

In the above example three replicas of application would prefer to be scheduled on Kubernetes nodes spread in different availability zones.

For more examples please see the Best practices linked below.

See also: