diff --git a/charts/rancher-monitoring/v0.0.4/charts/alertmanager/templates/alertmanager.yaml b/charts/rancher-monitoring/v0.0.4/charts/alertmanager/templates/alertmanager.yaml index 0821f964d0e2d3f6426bd132ea4298dda4fc753f..0b2239bdbcd18d5112b07546b0c8c29291953523 100644 --- a/charts/rancher-monitoring/v0.0.4/charts/alertmanager/templates/alertmanager.yaml +++ b/charts/rancher-monitoring/v0.0.4/charts/alertmanager/templates/alertmanager.yaml @@ -19,7 +19,7 @@ spec: release: {{ .Release.Name }} baseImage: {{ template "system_default_registry" . }}{{ .Values.image.repository }} nodeSelector: - beta.kubernetes.io/os: linux +{{- include "linux-node-selector" . | nindent 4 }} {{- range .Values.nodeSelectors }} {{- $pair := regexSplit "=" . 2 }} {{- if eq 2 (len $pair) }} diff --git a/charts/rancher-monitoring/v0.0.4/charts/exporter-kube-state/templates/deployment.yaml b/charts/rancher-monitoring/v0.0.4/charts/exporter-kube-state/templates/deployment.yaml index 853209d8f634899dbdd90d98f82347737901f2c4..fe764c94ce39cb8bfd4d070c5b05e98fe05186d6 100644 --- a/charts/rancher-monitoring/v0.0.4/charts/exporter-kube-state/templates/deployment.yaml +++ b/charts/rancher-monitoring/v0.0.4/charts/exporter-kube-state/templates/deployment.yaml @@ -56,7 +56,7 @@ spec: {{ toYaml .Values.tolerations | indent 8 }} {{- end }} nodeSelector: - beta.kubernetes.io/os: linux +{{- include "linux-node-selector" . | nindent 8 }} {{- range .Values.nodeSelectors }} {{- $pair := regexSplit "=" . 2 }} {{- if eq 2 (len $pair) }} diff --git a/charts/rancher-monitoring/v0.0.4/charts/exporter-node/templates/daemonset.yaml b/charts/rancher-monitoring/v0.0.4/charts/exporter-node/templates/daemonset.yaml index a9a2004dfe72d5a35128d35a4468fc27a7f27369..f3600fed9138343cae0e23cdf2387b806c13ccb8 100755 --- a/charts/rancher-monitoring/v0.0.4/charts/exporter-node/templates/daemonset.yaml +++ b/charts/rancher-monitoring/v0.0.4/charts/exporter-node/templates/daemonset.yaml @@ -73,7 +73,7 @@ spec: tolerations: - operator: Exists nodeSelector: - beta.kubernetes.io/os: linux +{{- include "linux-node-selector" . | nindent 8 }} {{- range .Values.nodeSelectors }} {{- $pair := regexSplit "=" . 2 }} {{- if eq 2 (len $pair) }} diff --git a/charts/rancher-monitoring/v0.0.4/charts/grafana/templates/deployment.yaml b/charts/rancher-monitoring/v0.0.4/charts/grafana/templates/deployment.yaml index c9c644d8451fb29ce9c862fd07af8c5795d150c3..688ff05878bf100736a11cad27e74b6145bb14cb 100755 --- a/charts/rancher-monitoring/v0.0.4/charts/grafana/templates/deployment.yaml +++ b/charts/rancher-monitoring/v0.0.4/charts/grafana/templates/deployment.yaml @@ -111,7 +111,7 @@ spec: {{ toYaml .Values.resources.proxy | indent 10 }} {{- end }} nodeSelector: - beta.kubernetes.io/os: linux +{{- include "linux-node-selector" . | nindent 8 }} {{- range .Values.nodeSelectors }} {{- $pair := regexSplit "=" . 2 }} {{- if eq 2 (len $pair) }} diff --git a/charts/rancher-monitoring/v0.0.4/charts/operator-init/templates/job-install-crds.yaml b/charts/rancher-monitoring/v0.0.4/charts/operator-init/templates/job-install-crds.yaml index 19027390ad7785083730316f9390ba6e3a71c335..0d1a73883294b3192668bb728290f6f906877e4f 100644 --- a/charts/rancher-monitoring/v0.0.4/charts/operator-init/templates/job-install-crds.yaml +++ b/charts/rancher-monitoring/v0.0.4/charts/operator-init/templates/job-install-crds.yaml @@ -11,6 +11,10 @@ spec: backoffLimit: 3 template: spec: + nodeSelector: +{{- include "linux-node-selector" . | nindent 8 }} + tolerations: +{{- include "linux-node-tolerations" . | nindent 8}} serviceAccountName: {{ template "app.fullname" . }} containers: - name: operator-init-crds diff --git a/charts/rancher-monitoring/v0.0.4/charts/operator/templates/deployment.yaml b/charts/rancher-monitoring/v0.0.4/charts/operator/templates/deployment.yaml index fbfc3628f4dc0bc65eb2725be157cfaa2f044b69..e0365723f67c1d876f1491398699db554d2c5038 100644 --- a/charts/rancher-monitoring/v0.0.4/charts/operator/templates/deployment.yaml +++ b/charts/rancher-monitoring/v0.0.4/charts/operator/templates/deployment.yaml @@ -57,7 +57,7 @@ spec: resources: {{ toYaml .Values.resources | indent 12 }} nodeSelector: - beta.kubernetes.io/os: linux +{{- include "linux-node-selector" . | nindent 8 }} {{- range .Values.nodeSelectors }} {{- $pair := regexSplit "=" . 2 }} {{- if eq 2 (len $pair) }} diff --git a/charts/rancher-monitoring/v0.0.4/charts/prometheus/templates/prometheus.yaml b/charts/rancher-monitoring/v0.0.4/charts/prometheus/templates/prometheus.yaml index 8a40740d9ae56b3d8d907d15f64c60bdc3b1ffd9..ff43c198c96ae71b5222d3e8935a795eb9d719de 100755 --- a/charts/rancher-monitoring/v0.0.4/charts/prometheus/templates/prometheus.yaml +++ b/charts/rancher-monitoring/v0.0.4/charts/prometheus/templates/prometheus.yaml @@ -109,7 +109,7 @@ spec: {{- end }} {{- end }} nodeSelector: - beta.kubernetes.io/os: linux +{{- include "linux-node-selector" . | nindent 4 }} {{- range .Values.nodeSelectors }} {{- $pair := regexSplit "=" . 2 }} {{- if eq 2 (len $pair) }} diff --git a/charts/rancher-monitoring/v0.0.4/templates/_helpers.tpl b/charts/rancher-monitoring/v0.0.4/templates/_helpers.tpl index 99ca862d929f6f11c0f9c558efe6f32990a20e74..bf05a61a479f67997edc7c5ef2ba7aa266dab352 100644 --- a/charts/rancher-monitoring/v0.0.4/templates/_helpers.tpl +++ b/charts/rancher-monitoring/v0.0.4/templates/_helpers.tpl @@ -136,4 +136,12 @@ add below linux tolerations to workloads could be scheduled to those linux nodes value: "linux" effect: "NoSchedule" operator: "Equal" -{{- end -}} \ No newline at end of file +{{- end -}} + +{{- define "linux-node-selector" -}} +{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}} +beta.kubernetes.io/os: linux +{{- else -}} +kubernetes.io/os: linux +{{- end -}} +{{- end -}}