Nginx ingress chart PSP uses not portable way to provide kubernetes 1.21+ compatibility
Currently it's implemented as
apiVersion: {{ ternary "policy/v1" "policy/v1beta1" (semverCompare ">=1.21.0-0" .Capabilities.KubeVersion.Version) }}
Unfortunately it's not the "right" way to implement it: not all environments provide .Capabilities.KubeVersion.Version
, eg: when you use helm templating.
The "correct" implementation should look like
{{ if $.Capabilities.APIVersions.Has "policy/v1/PodDisruptionBudget" -}}
apiVersion: policy/v1
{{- else -}}
apiVersion: policy/v1beta1
{{- end }}
Grep with Capabilities.APIVersions.Has
to see how it is implemented elsewhere in this repository.