integrate suggestions for PDB enhancements
This commit is contained in:
parent
8af604bdc7
commit
cc084df759
|
|
@ -61,6 +61,17 @@ Return the appropriate apiVersion for podSecurityPolicy.
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
{{- end -}}
|
{{- end -}}
|
||||||
|
|
||||||
|
{{/*
|
||||||
|
Return the appropriate apiVersion for podDisruptionBudget.
|
||||||
|
*/}}
|
||||||
|
{{- define "podDisruptionBudget.apiVersion" -}}
|
||||||
|
{{- if semverCompare ">=1.21-0" .Capabilities.KubeVersion.GitVersion -}}
|
||||||
|
{{- print "policy/v1" -}}
|
||||||
|
{{- else -}}
|
||||||
|
{{- print "policy/v1beta1" -}}
|
||||||
|
{{- end -}}
|
||||||
|
{{- end -}}
|
||||||
|
|
||||||
{{/*
|
{{/*
|
||||||
Common labels
|
Common labels
|
||||||
*/}}
|
*/}}
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,13 @@
|
||||||
{{ if gt .Values.replicaCount 1.0}}
|
{{- if .Values.podDisruptionBudget.enabled }}
|
||||||
apiVersion: policy/v1
|
apiVersion: {{ template "podDisruptionBudget.apiVersion" . }}
|
||||||
kind: PodDisruptionBudget
|
kind: PodDisruptionBudget
|
||||||
metadata:
|
metadata:
|
||||||
labels:
|
labels:
|
||||||
{{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
|
{{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
|
||||||
name: {{ template "nfs-subdir-external-provisioner.fullname" . }}
|
name: {{ template "nfs-subdir-external-provisioner.fullname" . }}
|
||||||
namespace: {{ .Release.Namespace }}
|
|
||||||
spec:
|
spec:
|
||||||
maxUnavailable: 1
|
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable | default 1 }}
|
||||||
selector:
|
selector:
|
||||||
matchLabels:
|
matchLabels:
|
||||||
{{- include "nfs-subdir-external-provisioner.selectorLabels" . | nindent 6 }}
|
{{- include "nfs-subdir-external-provisioner.selectorLabels" . | nindent 6 }}
|
||||||
{{ end }}
|
{{- end }}
|
||||||
|
|
|
||||||
|
|
@ -108,3 +108,7 @@ affinity: {}
|
||||||
|
|
||||||
# Additional labels for any resource created
|
# Additional labels for any resource created
|
||||||
labels: {}
|
labels: {}
|
||||||
|
|
||||||
|
podDisruptionBudget:
|
||||||
|
enabled: false
|
||||||
|
maxUnavailable: 1
|
||||||
Loading…
Reference in New Issue