From b0df5fc2c3de07d37b5c1a6acbf8fefa24276149 Mon Sep 17 00:00:00 2001 From: Corey O'Brien Date: Thu, 19 Apr 2018 13:47:59 -0400 Subject: [PATCH] [stable/cluster-autoscaler] Add PDB (#4398) * [stable/cluster-autoscaler] Add PDB * [stable/cluster-autoscaler] Add missing Chart.yml meta * Make maxUnavailable configurable * Add labels and make configuration more robust * Bump version for new feature * Fixup readme * Make pbb values a string to make it easier to switch off the default --- stable/cluster-autoscaler/Chart.yaml | 2 +- stable/cluster-autoscaler/README.md | 1 + stable/cluster-autoscaler/templates/pdb.yaml | 17 +++++++++++++++++ stable/cluster-autoscaler/values.yaml | 4 ++++ 4 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 stable/cluster-autoscaler/templates/pdb.yaml diff --git a/stable/cluster-autoscaler/Chart.yaml b/stable/cluster-autoscaler/Chart.yaml index dc62cb2138..bffc836a9e 100644 --- a/stable/cluster-autoscaler/Chart.yaml +++ b/stable/cluster-autoscaler/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 description: Scales worker nodes within autoscaling groups. icon: https://github.com/kubernetes/kubernetes/blob/master/logo/logo.png name: cluster-autoscaler -version: 0.5.3 +version: 0.6.0 appVersion: 1.1.0 home: https://github.com/kubernetes/autoscaler sources: diff --git a/stable/cluster-autoscaler/README.md b/stable/cluster-autoscaler/README.md index f2c71675a4..3aa6ed07b8 100644 --- a/stable/cluster-autoscaler/README.md +++ b/stable/cluster-autoscaler/README.md @@ -84,6 +84,7 @@ Parameter | Description | Default `image.tag` | Image tag (used if `cloudProvider=aws`) | `v1.1.0` `image.pullPolicy` | Image pull policy (used if `cloudProvider=aws`) | `IfNotPresent` `extraArgs` | additional container arguments | `{}` +`podDisruptionBudget` | Pod disruption budget | `maxUnavailable: 1` `extraEnv` | additional container environment variables | `{}` `nodeSelector` | node labels for pod assignment | `{}` `podAnnotations` | annotations to add to each pod | `{}` diff --git a/stable/cluster-autoscaler/templates/pdb.yaml b/stable/cluster-autoscaler/templates/pdb.yaml new file mode 100644 index 0000000000..158f84f3e3 --- /dev/null +++ b/stable/cluster-autoscaler/templates/pdb.yaml @@ -0,0 +1,17 @@ +{{- if .Values.podDisruptionBudget -}} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + labels: + app: {{ template "cluster-autoscaler.name" . }} + chart: {{ .Chart.Name }}-{{ .Chart.Version }} + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + name: {{ template "cluster-autoscaler.fullname" . }} +spec: + selector: + matchLabels: + app: {{ template "cluster-autoscaler.name" . }} + release: {{ .Release.Name }} +{{ .Values.podDisruptionBudget | indent 2 }} +{{- end -}} diff --git a/stable/cluster-autoscaler/values.yaml b/stable/cluster-autoscaler/values.yaml index 7fc6e4d36e..450076310d 100644 --- a/stable/cluster-autoscaler/values.yaml +++ b/stable/cluster-autoscaler/values.yaml @@ -39,6 +39,10 @@ extraArgs: {} ## Ref: https://kubernetes.io/docs/concepts/configuration/assign-pod-node/#affinity-and-anti-affinity ## affinity: {} +podDisruptionBudget: | + maxUnavailable: 1 + # minAvailable: 2 + ## Node labels for pod assignment ## Ref: https://kubernetes.io/docs/user-guide/node-selection/ nodeSelector: {}