diff --git a/charts/apisix/templates/pdb.yaml b/charts/apisix/templates/pdb.yaml index df8b7966..d006cf9c 100644 --- a/charts/apisix/templates/pdb.yaml +++ b/charts/apisix/templates/pdb.yaml @@ -15,7 +15,11 @@ # limitations under the License. {{- if (.Values.podDisruptionBudget.enabled) }} +{{ if semverCompare "<1.21-0" .Capabilities.KubeVersion.Version -}} apiVersion: policy/v1beta1 +{{- else -}} +apiVersion: policy/v1 +{{- end }} kind: PodDisruptionBudget metadata: name: {{ include "apisix.fullname" . }}