diff --git a/stable/node-problem-detector/Chart.yaml b/stable/node-problem-detector/Chart.yaml index 5ff5359ae0..e95922ac5d 100644 --- a/stable/node-problem-detector/Chart.yaml +++ b/stable/node-problem-detector/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: node-problem-detector -version: "1.6.1" +version: "1.6.2" appVersion: v0.7.0 home: https://github.com/kubernetes/node-problem-detector description: Installs the node-problem-detector daemonset for monitoring extra attributes on nodes diff --git a/stable/node-problem-detector/templates/_helpers.tpl b/stable/node-problem-detector/templates/_helpers.tpl index 25077d3171..d3d3776464 100644 --- a/stable/node-problem-detector/templates/_helpers.tpl +++ b/stable/node-problem-detector/templates/_helpers.tpl @@ -48,3 +48,14 @@ Create the name of the configmap for storing custom monitor definitions {{- $fullname := include "node-problem-detector.fullname" . -}} {{- printf "%s-custom-config" $fullname | replace "+" "_" | trunc 63 -}} {{- end -}} + +{{/* +Return the appropriate apiVersion for podSecurityPolicy. +*/}} +{{- define "podSecurityPolicy.apiVersion" -}} +{{- if semverCompare ">=1.10-0" .Capabilities.KubeVersion.GitVersion -}} +{{- print "policy/v1beta1" -}} +{{- else -}} +{{- print "extensions/v1beta1" -}} +{{- end -}} +{{- end -}} diff --git a/stable/node-problem-detector/templates/psp.yaml b/stable/node-problem-detector/templates/psp.yaml index c00ec6e91a..5c14753d45 100644 --- a/stable/node-problem-detector/templates/psp.yaml +++ b/stable/node-problem-detector/templates/psp.yaml @@ -1,5 +1,5 @@ {{- if .Values.rbac.pspEnabled }} -apiVersion: extensions/v1beta1 +apiVersion: {{ template "podSecurityPolicy.apiVersion" . }} kind: PodSecurityPolicy metadata: name: {{ template "node-problem-detector.fullname" . }}