From 7397365c51452872156eb972492c0465b8aa04ef Mon Sep 17 00:00:00 2001 From: Jack Francis Date: Fri, 6 May 2022 10:00:27 -0700 Subject: [PATCH] helm: ensure kured on 1.24 gets the correct toleration --- charts/kured/Chart.yaml | 2 +- charts/kured/README.md | 2 +- charts/kured/templates/daemonset.yaml | 12 +++++++++++- charts/kured/values.yaml | 4 +--- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/charts/kured/Chart.yaml b/charts/kured/Chart.yaml index 838f587..a1a847c 100644 --- a/charts/kured/Chart.yaml +++ b/charts/kured/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: "1.9.2" description: A Helm chart for kured name: kured -version: 2.13.0 +version: 2.14.0 home: https://github.com/weaveworks/kured maintainers: - name: ckotzbauer diff --git a/charts/kured/README.md b/charts/kured/README.md index 949bfe9..a129b5a 100644 --- a/charts/kured/README.md +++ b/charts/kured/README.md @@ -92,7 +92,7 @@ The following changes have been made compared to the stable chart: | `service.annotations` | Annotations to apply to the service (eg to add Prometheus annotations) | `{}` | | `podLabels` | Additional labels for pods (e.g. CostCenter=IT) | `{}` | | `priorityClassName` | Priority Class to be used by the pods | `""` | -| `tolerations` | Tolerations to apply to the daemonset (eg to allow running on master) | `[{"key": "node-role.kubernetes.io/master", "effect": "NoSchedule"}]`| +| `tolerations` | Tolerations to apply to the daemonset (eg to allow running on master) | `[{"key": "node-role.kubernetes.io/control-plane", "effect": "NoSchedule"}]` for Kubernetes 1.24.0 and greater, otherwise `[{"key": "node-role.kubernetes.io/master", "effect": "NoSchedule"}]`| | `affinity` | Affinity for the daemonset (ie, restrict which nodes kured runs on) | `{}` | | `nodeSelector` | Node Selector for the daemonset (ie, restrict which nodes kured runs on) | `{}` | | `volumeMounts` | Maps of volumes mount to mount | `{}` | diff --git a/charts/kured/templates/daemonset.yaml b/charts/kured/templates/daemonset.yaml index fada94f..0b592e2 100644 --- a/charts/kured/templates/daemonset.yaml +++ b/charts/kured/templates/daemonset.yaml @@ -169,9 +169,19 @@ spec: {{- if .Values.extraEnvVars }} {{ toYaml .Values.extraEnvVars | nindent 12 }} {{- end }} - {{- with .Values.tolerations }} tolerations: + {{- if .Values.tolerations }} + {{- with .Values.tolerations }} {{ toYaml . | indent 8 }} + {{- end }} + {{- else }} + {{- if ge .Capabilities.KubeVersion.Minor "24" -}} + - key: node-role.kubernetes.io/control-plane + effect: NoSchedule + {{- else }} + - key: node-role.kubernetes.io/master + effect: NoSchedule + {{- end }} {{- end }} {{- with .Values.nodeSelector }} nodeSelector: diff --git a/charts/kured/values.yaml b/charts/kured/values.yaml index e77da61..0a6da63 100644 --- a/charts/kured/values.yaml +++ b/charts/kured/values.yaml @@ -87,9 +87,7 @@ podLabels: {} priorityClassName: "" -tolerations: - - key: node-role.kubernetes.io/master - effect: NoSchedule +tolerations: [] affinity: {}