From e6503a5c4b0527da879f666c9f9ba4222f61a36e Mon Sep 17 00:00:00 2001
From: Victoria <victoriaalee@users.noreply.github.com>
Date: Thu, 9 May 2019 13:37:22 -0500
Subject: [PATCH] add optional PodDisruptionBudget to helm chart (#515)

* add optional PodDisruptionBudget to helm chart

* address comments

* add back new line - no change to helpers template

* fix silly typo in loki-stack version
---
 production/helm/loki-stack/Chart.yaml       |  2 +-
 production/helm/loki/Chart.yaml             |  2 +-
 production/helm/loki/templates/_helpers.tpl |  1 -
 production/helm/loki/templates/pdb.yaml     | 15 +++++++++++++++
 production/helm/loki/values.yaml            |  6 ++++++
 5 files changed, 23 insertions(+), 3 deletions(-)
 create mode 100644 production/helm/loki/templates/pdb.yaml

diff --git a/production/helm/loki-stack/Chart.yaml b/production/helm/loki-stack/Chart.yaml
index 09803be5..30d3301d 100644
--- a/production/helm/loki-stack/Chart.yaml
+++ b/production/helm/loki-stack/Chart.yaml
@@ -1,5 +1,5 @@
 name: loki-stack
-version: 0.8.1
+version: 0.9.0
 appVersion: 0.0.1
 kubeVersion: "^1.10.0-0"
 description: "Loki: like Prometheus, but for logs."
diff --git a/production/helm/loki/Chart.yaml b/production/helm/loki/Chart.yaml
index 7c7753f7..734fb875 100644
--- a/production/helm/loki/Chart.yaml
+++ b/production/helm/loki/Chart.yaml
@@ -1,5 +1,5 @@
 name: loki
-version: 0.7.2
+version: 0.8.0
 appVersion: 0.0.1
 kubeVersion: "^1.10.0-0"
 description: "Loki: like Prometheus, but for logs."
diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl
index 60875337..2e333aae 100644
--- a/production/helm/loki/templates/_helpers.tpl
+++ b/production/helm/loki/templates/_helpers.tpl
@@ -41,4 +41,3 @@ Create the name of the service account
     {{ default "default" .Values.serviceAccount.name }}
 {{- end -}}
 {{- end -}}
-
diff --git a/production/helm/loki/templates/pdb.yaml b/production/helm/loki/templates/pdb.yaml
new file mode 100644
index 00000000..79573361
--- /dev/null
+++ b/production/helm/loki/templates/pdb.yaml
@@ -0,0 +1,15 @@
+{{- if .Values.podDisruptionBudget -}}
+apiVersion: policy/v1beta1
+kind: PodDisruptionBudget
+metadata:
+  name: {{ template "loki.fullname" . }}
+  app: {{ template "loki.name" . }}
+  heritage: {{ .Release.Service }}
+  release: {{ .Release.Name }}
+  chart: {{ template "loki.chart" . }}
+spec:
+  selector:
+    matchLabels:
+      app: {{ template "loki.name" . }}
+{{ toYaml .Values.podDisruptionBudget | indent 2 }}
+{{- end -}}
\ No newline at end of file
diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml
index 32ed62c5..84c06fc6 100644
--- a/production/helm/loki/values.yaml
+++ b/production/helm/loki/values.yaml
@@ -150,3 +150,9 @@ terminationGracePeriodSeconds: 30
 ## Tolerations for pod assignment
 ## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/
 tolerations: []
+
+# The values to set in the PodDisruptionBudget spec
+# If not set then a PodDisruptionBudget will not be created
+podDisruptionBudget: {}
+# minAvailable: 1
+# maxUnavailable: 1
-- 
GitLab