From 5804c2b137b1afc980f46f0ffb8c6e2a66511521 Mon Sep 17 00:00:00 2001 From: Victoria Lee Date: Thu, 25 Apr 2019 15:13:09 -0500 Subject: [PATCH 1/4] add optional PodDisruptionBudget to helm chart --- production/helm/loki/Chart.yaml | 2 +- production/helm/loki/templates/_helpers.tpl | 10 ++++++++++ production/helm/loki/templates/pdb.yaml | 12 ++++++++++++ production/helm/loki/values.yaml | 4 ++++ 4 files changed, 27 insertions(+), 1 deletion(-) create mode 100644 production/helm/loki/templates/pdb.yaml diff --git a/production/helm/loki/Chart.yaml b/production/helm/loki/Chart.yaml index e6cc11d368755..734fb87593ba5 100644 --- a/production/helm/loki/Chart.yaml +++ b/production/helm/loki/Chart.yaml @@ -1,5 +1,5 @@ name: loki -version: 0.7.0 +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 608753377ebe9..f8ab490b67cd1 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -42,3 +42,13 @@ Create the name of the service account {{- end -}} {{- end -}} +{{/* Generate basic labels */}} +{{- define "loki.labels" }} +app: {{ template "loki.name" . }} +heritage: {{ .Release.Service }} +release: {{ .Release.Name }} +chart: {{ template "sentry-kubernetes.chart" . }} +{{- if .Values.podLabels }} +{{ toYaml .Values.podLabels }} +{{- end }} +{{- end }} \ No newline at end of file diff --git a/production/helm/loki/templates/pdb.yaml b/production/helm/loki/templates/pdb.yaml new file mode 100644 index 0000000000000..c8950d29c71d7 --- /dev/null +++ b/production/helm/loki/templates/pdb.yaml @@ -0,0 +1,12 @@ +{{- if .Values.podDisruptionBudget -}} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: {{ template "loki.fullname" . }} + labels: {{ include "loki.defaultLabels" . | indent 4 }} +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 c4450402736d2..6bf98a332c0b1 100644 --- a/production/helm/loki/values.yaml +++ b/production/helm/loki/values.yaml @@ -144,3 +144,7 @@ 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 (minAvailable/maxUnavailable) +# If not set then a PodDisruptionBudget will not be created +podDisruptionBudget: From 68697b013acfbd36b7080a8881e2f17268995c39 Mon Sep 17 00:00:00 2001 From: Victoria Lee Date: Mon, 6 May 2019 16:42:46 -0500 Subject: [PATCH 2/4] address comments --- production/helm/loki-stack/Chart.yaml | 2 +- production/helm/loki/templates/_helpers.tpl | 13 +------------ production/helm/loki/templates/pdb.yaml | 5 ++++- production/helm/loki/values.yaml | 6 ++++-- 4 files changed, 10 insertions(+), 16 deletions(-) diff --git a/production/helm/loki-stack/Chart.yaml b/production/helm/loki-stack/Chart.yaml index 20802571051e0..777922dc2bbad 100644 --- a/production/helm/loki-stack/Chart.yaml +++ b/production/helm/loki-stack/Chart.yaml @@ -1,5 +1,5 @@ name: loki-stack -version: 0.7.1 +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 f8ab490b67cd1..b5a269e9393d7 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -40,15 +40,4 @@ Create the name of the service account {{- else -}} {{ default "default" .Values.serviceAccount.name }} {{- end -}} -{{- end -}} - -{{/* Generate basic labels */}} -{{- define "loki.labels" }} -app: {{ template "loki.name" . }} -heritage: {{ .Release.Service }} -release: {{ .Release.Name }} -chart: {{ template "sentry-kubernetes.chart" . }} -{{- if .Values.podLabels }} -{{ toYaml .Values.podLabels }} -{{- end }} -{{- end }} \ No newline at end of file +{{- end -}} \ No newline at end of file diff --git a/production/helm/loki/templates/pdb.yaml b/production/helm/loki/templates/pdb.yaml index c8950d29c71d7..795733619d5e2 100644 --- a/production/helm/loki/templates/pdb.yaml +++ b/production/helm/loki/templates/pdb.yaml @@ -3,7 +3,10 @@ apiVersion: policy/v1beta1 kind: PodDisruptionBudget metadata: name: {{ template "loki.fullname" . }} - labels: {{ include "loki.defaultLabels" . | indent 4 }} + app: {{ template "loki.name" . }} + heritage: {{ .Release.Service }} + release: {{ .Release.Name }} + chart: {{ template "loki.chart" . }} spec: selector: matchLabels: diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml index 6bf98a332c0b1..648d1b0962513 100644 --- a/production/helm/loki/values.yaml +++ b/production/helm/loki/values.yaml @@ -145,6 +145,8 @@ terminationGracePeriodSeconds: 30 ## ref: https://kubernetes.io/docs/concepts/configuration/taint-and-toleration/ tolerations: [] -# The values to set in the PodDisruptionBudget spec (minAvailable/maxUnavailable) +# The values to set in the PodDisruptionBudget spec # If not set then a PodDisruptionBudget will not be created -podDisruptionBudget: +podDisruptionBudget: {} +# minAvailable: 1 +# maxUnavailable: 1 From b48aff8715382edd31114dd7db0688de46d8cea5 Mon Sep 17 00:00:00 2001 From: Victoria Lee Date: Mon, 6 May 2019 16:49:50 -0500 Subject: [PATCH 3/4] add back new line - no change to helpers template --- production/helm/loki/templates/_helpers.tpl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki/templates/_helpers.tpl b/production/helm/loki/templates/_helpers.tpl index b5a269e9393d7..2e333aae60f88 100644 --- a/production/helm/loki/templates/_helpers.tpl +++ b/production/helm/loki/templates/_helpers.tpl @@ -40,4 +40,4 @@ Create the name of the service account {{- else -}} {{ default "default" .Values.serviceAccount.name }} {{- end -}} -{{- end -}} \ No newline at end of file +{{- end -}} From 9db630f92187968ec188c7a9b674685909c06b40 Mon Sep 17 00:00:00 2001 From: Victoria Lee Date: Thu, 9 May 2019 12:17:14 -0500 Subject: [PATCH 4/4] fix silly typo in loki-stack version --- production/helm/loki-stack/Chart.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/production/helm/loki-stack/Chart.yaml b/production/helm/loki-stack/Chart.yaml index 117c082203a63..30d3301d13e34 100644 --- a/production/helm/loki-stack/Chart.yaml +++ b/production/helm/loki-stack/Chart.yaml @@ -1,5 +1,5 @@ name: loki-stack -version: 0.9/0 +version: 0.9.0 appVersion: 0.0.1 kubeVersion: "^1.10.0-0" description: "Loki: like Prometheus, but for logs."