[stable/datadog] Always add os in nodeSelector based on targetSystem (#23199)

Signed-off-by: Vincent Boulineau <vincent.boulineau@datadoghq.com>
This commit is contained in:
Vincent Boulineau
2020-07-15 08:50:38 -07:00
committed by GitHub
parent fbf8233ea4
commit 1aec76c088
6 changed files with 23 additions and 4 deletions
+5
View File
@@ -1,6 +1,11 @@
# Datadog changelog
## 2.3.32
* Always add os in nodeSelector based on `targetSystem`
## 2.3.31
* Fixed daemonset template for go 1.14
## 2.3.29
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: datadog
version: 2.3.31
version: 2.3.32
appVersion: "7"
description: Datadog Agent
keywords:
+11
View File
@@ -90,6 +90,17 @@ Return the appropriate apiVersion for RBAC APIs.
{{- end -}}
{{- end -}}
{{/*
Return the appropriate os label
*/}}
{{- define "label.os" -}}
{{- if semverCompare "^1.14-0" .Capabilities.KubeVersion.GitVersion -}}
kubernetes.io/os
{{- else -}}
beta.kubernetes.io/os
{{- end -}}
{{- end -}}
{{/*
Return the container runtime socket
*/}}
@@ -126,8 +126,9 @@ spec:
app: {{ template "datadog.fullname" . }}-clusterchecks
topologyKey: kubernetes.io/hostname
{{- end }}
{{- if .Values.clusterChecksRunner.nodeSelector }}
nodeSelector:
{{ template "label.os" . }}: {{ .Values.targetSystem }}
{{- if .Values.clusterChecksRunner.nodeSelector }}
{{ toYaml .Values.clusterChecksRunner.nodeSelector | indent 8 }}
{{- end }}
{{- if .Values.clusterChecksRunner.tolerations }}
@@ -216,5 +216,8 @@ spec:
{{ toYaml .Values.clusterAgent.affinity | indent 8 }}
{{- end }}
nodeSelector:
{{ template "label.os" . }}: {{ .Values.targetSystem }}
{{- if .Values.clusterAgent.nodeSelector }}
{{ toYaml .Values.clusterAgent.nodeSelector | indent 8 }}
{{- end }}
{{ end }}
+1 -2
View File
@@ -131,10 +131,9 @@ spec:
{{ toYaml .Values.agents.affinity | indent 8 }}
serviceAccountName: {{ if .Values.agents.rbac.create }}{{ template "datadog.fullname" . }}{{ else }}"{{ .Values.agents.rbac.serviceAccountName }}"{{ end }}
nodeSelector:
{{ template "label.os" . }}: {{ .Values.targetSystem }}
{{- if .Values.agents.nodeSelector }}
{{ toYaml .Values.agents.nodeSelector | indent 8 }}
{{- else if eq .Values.targetSystem "windows" }}
kubernetes.io/os: windows
{{- end }}
updateStrategy:
{{ toYaml .Values.agents.updateStrategy | indent 4 }}