Unverified Commit cc084df7 by Dan Committed by GitHub

integrate suggestions for PDB enhancements

parent 8af604bd
......@@ -62,6 +62,17 @@ Return the appropriate apiVersion for podSecurityPolicy.
{{- 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
*/}}
{{- define "nfs-subdir-external-provisioner.labels" -}}
......
{{ 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
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment