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 -}}
|
||||
|
||||
{{/*
|
||||
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
|
||||
*/}}
|
||||
|
|
|
|||
|
|
@ -1,14 +1,13 @@
|
|||
{{ if gt .Values.replicaCount 1.0}}
|
||||
apiVersion: policy/v1
|
||||
{{- if .Values.podDisruptionBudget.enabled }}
|
||||
apiVersion: {{ template "podDisruptionBudget.apiVersion" . }}
|
||||
kind: PodDisruptionBudget
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "nfs-subdir-external-provisioner.labels" . | nindent 4 }}
|
||||
name: {{ template "nfs-subdir-external-provisioner.fullname" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
spec:
|
||||
maxUnavailable: 1
|
||||
maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable | default 1 }}
|
||||
selector:
|
||||
matchLabels:
|
||||
{{- include "nfs-subdir-external-provisioner.selectorLabels" . | nindent 6 }}
|
||||
{{ end }}
|
||||
{{- end }}
|
||||
|
|
|
|||
|
|
@ -108,3 +108,7 @@ affinity: {}
|
|||
|
||||
# Additional labels for any resource created
|
||||
labels: {}
|
||||
|
||||
podDisruptionBudget:
|
||||
enabled: false
|
||||
maxUnavailable: 1
|
||||
Loading…
Reference in New Issue