diff --git a/charts/mysql-operator/templates/deployment.yaml b/charts/mysql-operator/templates/deployment.yaml index c876c628..d4f5e9c4 100644 --- a/charts/mysql-operator/templates/deployment.yaml +++ b/charts/mysql-operator/templates/deployment.yaml @@ -72,3 +72,22 @@ spec: {{ toYaml .Values.manager.resources | indent 10 }} serviceAccountName: {{ template "serviceAccountName" . }} terminationGracePeriodSeconds: 10 + tolerations: + - key: node.kubernetes.io/not-ready + operator: Exists + effect: NoExecute + tolerationSeconds: {{ .Values.tolerationSeconds }} + - key: node.kubernetes.io/unreachable + operator: Exists + effect: NoExecute + tolerationSeconds: {{ .Values.tolerationSeconds }} + affinity: + podAntiAffinity: + requiredDuringSchedulingIgnoredDuringExecution: + - labelSelector: + matchExpressions: + - key: app + operator: In + values: + - {{ template "mysql-operator.name" . }} + topologyKey: "kubernetes.io/hostname" diff --git a/charts/mysql-operator/values.yaml b/charts/mysql-operator/values.yaml index bc86ca46..4213e893 100644 --- a/charts/mysql-operator/values.yaml +++ b/charts/mysql-operator/values.yaml @@ -14,6 +14,11 @@ nameOverride: "" fullnameOverride: "" imagePrefix: "" +## node.kubernetes.io/not-ready:NoExecute +## node.kubernetes.io/unreachable:NoExecute +## operator`s toleration time of the above two taints. +tolerationSeconds: 30 + manager: image: radondb/mysql-operator tag: latest