radondb-mysql-kubernetes
radondb-mysql-kubernetes copied to clipboard
[question] How to set pod anti affinity to ensure high availability?
General Question
How to set pod anti affinity?
It is necessary to ensure that the database node is scheduled in different workers, you can refer to the following configuration of the anti-affinity of POD.
podPolicy:
...
affinity:
podAntiAffinity:
requiredDuringSchedulingIgnoredDuringExecution:
- labelSelector:
matchExpressions:
- key: mysql.radondb.com/cluster
operator: In
values:
- sample
topologyKey: "kubernetes.io/hostname"