[stable/fluent-bit] Use apps/v1 api for DaemonSet if k8s > 1.9 (#17834) (#17838)

Signed-off-by: László Kondás <laszlo.kondas@gmail.com>
This commit is contained in:
kondas
2019-10-09 12:17:49 -07:00
committed by Kubernetes Prow Robot
parent 95e8f1091a
commit 7cb24caa54
3 changed files with 20 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
apiVersion: v1
name: fluent-bit
version: 2.7.1
version: 2.7.2
appVersion: 1.2.2
description: Fast and Lightweight Log/Data Forwarder for Linux, BSD and OSX
keywords:
+11
View File
@@ -65,3 +65,14 @@ Return the appropriate apiGroup for PodSecurityPolicy.
{{- print "policy" -}}
{{- end -}}
{{- end -}}
{{/*
Return the appropriate apiVersion for DaemonSet.
*/}}
{{- define "daemonSet.apiVersion" -}}
{{- if semverCompare "<1.9-0" .Capabilities.KubeVersion.GitVersion -}}
{{- print "extensions/v1beta1" -}}
{{- else -}}
{{- print "apps/v1" -}}
{{- end -}}
{{- end -}}
+8 -1
View File
@@ -1,4 +1,4 @@
apiVersion: extensions/v1beta1
apiVersion: {{ template "daemonSet.apiVersion" . }}
kind: DaemonSet
metadata:
name: {{ template "fluent-bit.fullname" . }}
@@ -8,6 +8,13 @@ metadata:
heritage: {{ .Release.Service }}
release: {{ .Release.Name }}
spec:
selector:
matchLabels:
app: {{ template "fluent-bit.name" . }}
release: {{ .Release.Name }}
{{- if .Values.podLabels }}
{{ toYaml .Values.podLabels | indent 6 }}
{{- end }}
updateStrategy:
type: RollingUpdate
template: