diff --git a/charts/mageai/templates/pdb-scheduler.yaml b/charts/mageai/templates/pdb-scheduler.yaml new file mode 100644 index 0000000..8ad21b6 --- /dev/null +++ b/charts/mageai/templates/pdb-scheduler.yaml @@ -0,0 +1,20 @@ +{{- if and .Values.standaloneScheduler .Values.scheduler.pdb.create }} +--- +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "mageai.fullname" . }} + labels: + {{- include "mageai.labels" . | nindent 4 }} +spec: + {{- if .Values.scheduler.pdb.minAvailable }} + minAvailable: {{ .Values.scheduler.pdb.minAvailable }} + {{- end }} + {{- if or .Values.scheduler.pdb.maxUnavailable ( not .Values.scheduler.pdb.minAvailable ) }} + maxUnavailable: {{ .Values.scheduler.pdb.maxUnavailable | default 1 }} + {{- end }} + selector: + matchLabels: + {{- include "mageai.schedulerSelectorLabels" . | nindent 6 }} +... +{{- end }} diff --git a/charts/mageai/templates/pdb-webserver.yaml b/charts/mageai/templates/pdb-webserver.yaml new file mode 100644 index 0000000..cc992db --- /dev/null +++ b/charts/mageai/templates/pdb-webserver.yaml @@ -0,0 +1,20 @@ +{{- if and .Values.standaloneScheduler .Values.webServer.pdb.create }} +--- +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ .Values.webServer.name }} + labels: + {{- include "mageai.labels" . | nindent 4 }} +spec: + {{- if .Values.webServer.pdb.minAvailable }} + minAvailable: {{ .Values.webServer.pdb.minAvailable }} + {{- end }} + {{- if or .Values.webServer.pdb.maxUnavailable ( not .Values.webServer.pdb.minAvailable ) }} + maxUnavailable: {{ .Values.webServer.pdb.maxUnavailable | default 1 }} + {{- end }} + selector: + matchLabels: + {{- include "mageai.selectorLabels" . | nindent 6 }} +... +{{- end }} diff --git a/charts/mageai/templates/pdb.yaml b/charts/mageai/templates/pdb.yaml new file mode 100644 index 0000000..91a0c9a --- /dev/null +++ b/charts/mageai/templates/pdb.yaml @@ -0,0 +1,20 @@ +{{- if and (not .Values.standaloneScheduler) .Values.pdb.create }} +--- +apiVersion: policy/v1 +kind: PodDisruptionBudget +metadata: + name: {{ include "mageai.fullname" . }} + labels: + {{- include "mageai.labels" . | nindent 4 }} +spec: + {{- if .Values.pdb.minAvailable }} + minAvailable: {{ .Values.pdb.minAvailable }} + {{- end }} + {{- if or .Values.pdb.maxUnavailable ( not .Values.pdb.minAvailable ) }} + maxUnavailable: {{ .Values.pdb.maxUnavailable | default 1 }} + {{- end }} + selector: + matchLabels: + {{- include "mageai.selectorLabels" . | nindent 6 }} +... +{{- end }} diff --git a/charts/mageai/values.yaml b/charts/mageai/values.yaml index 7830b97..6349d1e 100644 --- a/charts/mageai/values.yaml +++ b/charts/mageai/values.yaml @@ -24,6 +24,9 @@ scheduler: # minReplicas: 1 # maxReplicas: 10 # targetCPUUtilizationPercentage: 50 + pdb: + create: false + maxUnavailable: "50%" # Effective if standaloneScheduler is true webServer: @@ -44,6 +47,9 @@ webServer: # minReplicas: 1 # maxReplicas: 10 # targetCPUUtilizationPercentage: 50 + pdb: + create: false + maxUnavailable: 50% # Enable Postgres as the DB postgresql: @@ -170,6 +176,10 @@ resources: {} # cpu: 100m # memory: 128Mi +pdb: + create: false + maxUnavailable: 50% + nodeSelector: {} tolerations: []