diff --git a/charts/flagger/templates/pdb.yaml b/charts/flagger/templates/pdb.yaml index d716a8270..964919bd9 100644 --- a/charts/flagger/templates/pdb.yaml +++ b/charts/flagger/templates/pdb.yaml @@ -1,5 +1,9 @@ {{- if .Values.podDisruptionBudget.enabled }} +{{- if .Capabilities.APIVersions.Has "policy/v1" -}} +apiVersion: policy/v1 +{{- else }} apiVersion: policy/v1beta1 +{{- end }} kind: PodDisruptionBudget metadata: name: {{ template "flagger.name" . }} diff --git a/charts/loadtester/templates/pdb.yaml b/charts/loadtester/templates/pdb.yaml index ab9e1fd7c..edd28eac8 100644 --- a/charts/loadtester/templates/pdb.yaml +++ b/charts/loadtester/templates/pdb.yaml @@ -1,5 +1,9 @@ {{- if .Values.podDisruptionBudget.enabled }} +{{- if .Capabilities.APIVersions.Has "policy/v1" -}} +apiVersion: policy/v1 +{{- else }} apiVersion: policy/v1beta1 +{{- end }} kind: PodDisruptionBudget metadata: name: {{ include "loadtester.fullname" . }}