From a485daf73f22f7bd0a78706172ccb878a0f657ef Mon Sep 17 00:00:00 2001 From: Samuel Wyma Date: Tue, 3 Sep 2019 17:54:06 +0100 Subject: [PATCH] Be able to specify pod disruption budgets & replica counts --- charts/argo/templates/ui-deployment-pdb.yaml | 25 +++++++++++++++++++ charts/argo/templates/ui-deployment.yaml | 1 + .../workflow-controller-deployment-pdb.yaml | 23 +++++++++++++++++ .../workflow-controller-deployment.yaml | 1 + charts/argo/values.yaml | 10 ++++++++ 5 files changed, 60 insertions(+) create mode 100644 charts/argo/templates/ui-deployment-pdb.yaml create mode 100644 charts/argo/templates/workflow-controller-deployment-pdb.yaml diff --git a/charts/argo/templates/ui-deployment-pdb.yaml b/charts/argo/templates/ui-deployment-pdb.yaml new file mode 100644 index 00000000..333c7bc1 --- /dev/null +++ b/charts/argo/templates/ui-deployment-pdb.yaml @@ -0,0 +1,25 @@ +{{- if .Values.ui.enabled -}} +{{- if .Values.ui.pdb.enabled -}} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: {{ .Release.Name }}-{{ .Values.ui.name}} + labels: + app: {{ .Release.Name }}-{{ .Values.ui.name}} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + {{- if .Values.ui.pdb.minAvailable }} + minAvailable: {{ .Values.ui.pdb.minAvailable }} + {{- else if .Values.ui.pdb.maxUnavailable }} + maxUnavailable: {{ .Values.ui.pdb.maxUnavailable }} + {{- else }} + minAvailable: 0 + {{- end }} + selector: + matchLabels: + app: {{ .Release.Name }}-{{ .Values.ui.name}} + release: {{ .Release.Name }} +{{- end -}} +{{- end -}} diff --git a/charts/argo/templates/ui-deployment.yaml b/charts/argo/templates/ui-deployment.yaml index 54b5c835..53ed8758 100644 --- a/charts/argo/templates/ui-deployment.yaml +++ b/charts/argo/templates/ui-deployment.yaml @@ -8,6 +8,7 @@ metadata: release: {{ .Release.Name }} heritage: {{ .Release.Service }} spec: + replicas: {{ .Values.ui.replicas }} template: metadata: labels: diff --git a/charts/argo/templates/workflow-controller-deployment-pdb.yaml b/charts/argo/templates/workflow-controller-deployment-pdb.yaml new file mode 100644 index 00000000..a7352a04 --- /dev/null +++ b/charts/argo/templates/workflow-controller-deployment-pdb.yaml @@ -0,0 +1,23 @@ +{{- if .Values.controller.pdb.enabled }} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: {{ .Release.Name }}-{{ .Values.controller.name}} + labels: + app: {{ .Release.Name }}-{{ .Values.controller.name}} + chart: {{ .Chart.Name }}-{{ .Chart.Version | replace "+" "_" }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +spec: + {{- if .Values.controller.pdb.minAvailable }} + minAvailable: {{ .Values.controller.pdb.minAvailable }} + {{- else if .Values.controller.pdb.maxUnavailable }} + maxUnavailable: {{ .Values.controller.pdb.maxUnavailable }} + {{- else }} + minAvailable: 0 + {{- end }} + selector: + matchLabels: + app: {{ .Release.Name }}-{{ .Values.controller.name}} + release: {{ .Release.Name }} +{{- end }} diff --git a/charts/argo/templates/workflow-controller-deployment.yaml b/charts/argo/templates/workflow-controller-deployment.yaml index 5a19b5a2..4a9ca1c2 100644 --- a/charts/argo/templates/workflow-controller-deployment.yaml +++ b/charts/argo/templates/workflow-controller-deployment.yaml @@ -8,6 +8,7 @@ metadata: release: {{ .Release.Name }} heritage: {{ .Release.Service }} spec: + replicas: {{ .Values.controller.replicas }} template: metadata: labels: diff --git a/charts/argo/values.yaml b/charts/argo/values.yaml index c1c5545c..ff23183c 100644 --- a/charts/argo/values.yaml +++ b/charts/argo/values.yaml @@ -64,6 +64,11 @@ controller: # service type `LoadBalancer` loadBalancerSourceRanges: [] resources: {} + replicas: 1 + pdb: + enabled: false + # minAvailable: 1 + # maxUnavailable: 1 executor: image: @@ -97,6 +102,11 @@ ui: # service type `LoadBalancer` loadBalancerSourceRanges: [] resources: {} + replicas: 1 + pdb: + enabled: false + # minAvailable: 1 + # maxUnavailable: 1 ## Ingress configuration. ## ref: https://kubernetes.io/docs/user-guide/ingress/