diff --git a/stable/fluent-bit/Chart.yaml b/stable/fluent-bit/Chart.yaml index 667edc328b..f18ff784e2 100755 --- a/stable/fluent-bit/Chart.yaml +++ b/stable/fluent-bit/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: fluent-bit -version: 2.4.1 +version: 2.4.2 appVersion: 1.2.1 description: Fast and Lightweight Log/Data Forwarder for Linux, BSD and OSX keywords: diff --git a/stable/fluent-bit/templates/_helpers.tpl b/stable/fluent-bit/templates/_helpers.tpl index 42453daea6..59505cb5b3 100644 --- a/stable/fluent-bit/templates/_helpers.tpl +++ b/stable/fluent-bit/templates/_helpers.tpl @@ -55,3 +55,13 @@ Create the name of the service account to use {{- end -}} {{- end -}} +{{/* +Return the appropriate apiGroup for PodSecurityPolicy. +*/}} +{{- define "rbac.pspApiGroup" -}} +{{- if semverCompare "<1.14-0" .Capabilities.KubeVersion.GitVersion -}} +{{- print "extensions" -}} +{{- else if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +{{- print "policy" -}} +{{- end -}} +{{- end -}} diff --git a/stable/fluent-bit/templates/cluster-role.yaml b/stable/fluent-bit/templates/cluster-role.yaml index 19fbf626cb..69c79891d3 100644 --- a/stable/fluent-bit/templates/cluster-role.yaml +++ b/stable/fluent-bit/templates/cluster-role.yaml @@ -17,7 +17,7 @@ rules: - get {{- if .Values.rbac.pspEnabled }} - apiGroups: - - policy + - {{ template "rbac.pspApiGroup" . }} resources: - podsecuritypolicies resourceNames: