radondb-mysql-kubernetes icon indicating copy to clipboard operation
radondb-mysql-kubernetes copied to clipboard

[question] How to set pod anti affinity to ensure high availability?

Open runkecheng opened this issue 3 years ago • 0 comments

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"

runkecheng avatar Jan 18 '22 08:01 runkecheng