Support policy/v1 for PodDisruptionBudget for v1.21+
Remove warning of policy/v1beta1 deprecation ``` Warning: policy/v1beta1 PodDisruptionBudget is deprecated in v1.21+, unavailable in v1.25+; use policy/v1 PodDisruptionBudget ``` Reference: - https://kubernetes.io/docs/reference/using-api/deprecation-guide/#poddisruptionbudget-v125 Signed-off-by: guessi <guessi@gmail.com>
This commit is contained in:
parent
a13c59c243
commit
b57d917632
|
|
@ -17,4 +17,4 @@ name: cluster-autoscaler
|
||||||
sources:
|
sources:
|
||||||
- https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler
|
- https://github.com/kubernetes/autoscaler/tree/master/cluster-autoscaler
|
||||||
type: application
|
type: application
|
||||||
version: 9.18.0
|
version: 9.18.1
|
||||||
|
|
|
||||||
|
|
@ -75,6 +75,18 @@ Return the appropriate apiVersion for podsecuritypolicy.
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for podDisruptionBudget.
|
||||||
|
*/}}
|
||||||
|
{{- define "podDisruptionBudget.apiVersion" -}}
|
||||||
|
{{- $kubeTargetVersion := default .Capabilities.KubeVersion.GitVersion .Values.kubeTargetVersionOverride }}
|
||||||
|
{{- if semverCompare "<1.21-0" $kubeTargetVersion -}}
|
||||||
|
{{- print "policy/v1beta1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "policy/v1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Return the service account name used by the pod.
|
Return the service account name used by the pod.
|
||||||
*/}}
|
*/}}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{{- if .Values.podDisruptionBudget -}}
|
{{- if .Values.podDisruptionBudget -}}
|
||||||
apiVersion: policy/v1beta1
|
apiVersion: {{ template "podDisruptionBudget.apiVersion" . }}
|
||||||
kind: PodDisruptionBudget
|
kind: PodDisruptionBudget
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue