From a8a34c8564bcb6342079a4312fdd83028e1ef957 Mon Sep 17 00:00:00 2001 From: Peter Rifel Date: Mon, 9 Mar 2020 10:07:56 -0500 Subject: [PATCH] [stable/kube-state-metrics] Add PodDisruptionBudget Signed-off-by: Peter Rifel --- stable/kube-state-metrics/Chart.yaml | 2 +- stable/kube-state-metrics/README.md | 1 + stable/kube-state-metrics/templates/pdb.yaml | 17 +++++++++++++++++ stable/kube-state-metrics/values.yaml | 3 +++ 4 files changed, 22 insertions(+), 1 deletion(-) create mode 100644 stable/kube-state-metrics/templates/pdb.yaml diff --git a/stable/kube-state-metrics/Chart.yaml b/stable/kube-state-metrics/Chart.yaml index 69c07eae7ce2..f22c26b42016 100644 --- a/stable/kube-state-metrics/Chart.yaml +++ b/stable/kube-state-metrics/Chart.yaml @@ -6,7 +6,7 @@ keywords: - monitoring - prometheus - kubernetes -version: 2.8.1 +version: 2.8.2 appVersion: 1.9.5 home: https://github.com/kubernetes/kube-state-metrics/ sources: diff --git a/stable/kube-state-metrics/README.md b/stable/kube-state-metrics/README.md index 9038c5f25e9a..c7d21dd51a45 100644 --- a/stable/kube-state-metrics/README.md +++ b/stable/kube-state-metrics/README.md @@ -38,6 +38,7 @@ $ helm install stable/kube-state-metrics | `affinity` | Affinity settings for pod assignment | {} | | `tolerations` | Tolerations for pod assignment | [] | | `podAnnotations` | Annotations to be added to the pod | {} | +| `podDisruptionBudget` | Optional PodDisruptionBudget | {} | | `resources` | kube-state-metrics resource requests and limits | {} | | `collectors.certificatesigningrequests` | Enable the certificatesigningrequests collector. | `true` | | `collectors.configmaps` | Enable the configmaps collector. | `true` | diff --git a/stable/kube-state-metrics/templates/pdb.yaml b/stable/kube-state-metrics/templates/pdb.yaml new file mode 100644 index 000000000000..6adb50d79f04 --- /dev/null +++ b/stable/kube-state-metrics/templates/pdb.yaml @@ -0,0 +1,17 @@ +{{- if .Values.podDisruptionBudget -}} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: {{ template "kube-state-metrics.fullname" . }} + namespace: {{ template "kube-state-metrics.namespace" . }} + labels: + app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} + helm.sh/chart: "{{ .Chart.Name }}-{{ .Chart.Version }}" + app.kubernetes.io/instance: "{{ .Release.Name }}" + app.kubernetes.io/managed-by: "{{ .Release.Service }}" +spec: + selector: + matchLabels: + app.kubernetes.io/name: {{ template "kube-state-metrics.name" . }} +{{ toYaml .Values.podDisruptionBudget | indent 2 }} +{{- end -}} \ No newline at end of file diff --git a/stable/kube-state-metrics/values.yaml b/stable/kube-state-metrics/values.yaml index ebcebed57e15..11f20fa3ead6 100644 --- a/stable/kube-state-metrics/values.yaml +++ b/stable/kube-state-metrics/values.yaml @@ -86,6 +86,9 @@ podAnnotations: {} ## Assign a PriorityClassName to pods if set # priorityClassName: "" +# Ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/ +podDisruptionBudget: {} + # Available collectors for kube-state-metrics. By default all available # collectors are enabled. collectors: