diff --git a/stable/external-dns/Chart.yaml b/stable/external-dns/Chart.yaml index 6ea7d85138..1fc5bc730f 100644 --- a/stable/external-dns/Chart.yaml +++ b/stable/external-dns/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: external-dns -version: 2.6.3 +version: 2.6.4 appVersion: 0.5.17 description: ExternalDNS is a Kubernetes addon that configures public DNS servers with information about exposed Kubernetes services to make them discoverable. keywords: diff --git a/stable/external-dns/templates/_helpers.tpl b/stable/external-dns/templates/_helpers.tpl index 96f88028cb..fa6ab79cbb 100644 --- a/stable/external-dns/templates/_helpers.tpl +++ b/stable/external-dns/templates/_helpers.tpl @@ -206,6 +206,17 @@ external-dns: infoblox.wapiPassword {{- end -}} {{- end -}} +{{/* +Return the appropriate apiVersion for PodSecurityPolicy. +*/}} +{{- define "podSecurityPolicy.apiVersion" -}} +{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +{{- print "policy/v1beta1" -}} +{{- else -}} +{{- print "extensions/v1beta1" -}} +{{- end -}} +{{- end -}} + {{/* Validate values of External DNS: - must provide the PowerDNS API URL when provider is "pdns" diff --git a/stable/external-dns/templates/psp.yaml b/stable/external-dns/templates/psp.yaml index 5a1627829d..b944849016 100644 --- a/stable/external-dns/templates/psp.yaml +++ b/stable/external-dns/templates/psp.yaml @@ -1,5 +1,5 @@ {{- if .Values.rbac.pspEnabled }} -apiVersion: extensions/v1beta1 +apiVersion: {{ template "podSecurityPolicy.apiVersion" . }} kind: PodSecurityPolicy metadata: name: {{ template "external-dns.fullname" . }}