From c2e0cd5007378405dad9ea8b808a700868ca1818 Mon Sep 17 00:00:00 2001 From: switj Date: Fri, 11 Oct 2019 21:46:38 -0400 Subject: [PATCH] stable/grafana: add pod disruption budget (#17916) Signed-off-by: Josh Switnicki --- stable/grafana/Chart.yaml | 2 +- stable/grafana/README.md | 2 ++ .../templates/poddisruptionbudget.yaml | 25 +++++++++++++++++++ stable/grafana/values.yaml | 6 +++++ 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 stable/grafana/templates/poddisruptionbudget.yaml diff --git a/stable/grafana/Chart.yaml b/stable/grafana/Chart.yaml index 1b311a2a33..9c7368b8ad 100644 --- a/stable/grafana/Chart.yaml +++ b/stable/grafana/Chart.yaml @@ -1,6 +1,6 @@ apiVersion: v1 name: grafana -version: 3.10.0 +version: 3.10.1 appVersion: 6.4.2 kubeVersion: "^1.8.0-0" description: The leading tool for querying and visualizing time series and metrics. diff --git a/stable/grafana/README.md b/stable/grafana/README.md index 60d32e4ff7..26add4bc28 100644 --- a/stable/grafana/README.md +++ b/stable/grafana/README.md @@ -32,6 +32,8 @@ The command removes all the Kubernetes components associated with the chart and | Parameter | Description | Default | |-------------------------------------------|-----------------------------------------------|---------------------------------------------------------| | `replicas` | Number of nodes | `1` | +| `podDisruptionBudget.minAvailable` | Pod disruption minimum available | `nil` | +| `podDisruptionBudget.maxUnavailable` | Pod disruption maximum unavailable | `nil` | | `deploymentStrategy` | Deployment strategy | `{ "type": "RollingUpdate" }` | | `livenessProbe` | Liveness Probe settings | `{ "httpGet": { "path": "/api/health", "port": 3000 } "initialDelaySeconds": 60, "timeoutSeconds": 30, "failureThreshold": 10 }` | | `readinessProbe` | Readiness Probe settings | `{ "httpGet": { "path": "/api/health", "port": 3000 } }`| diff --git a/stable/grafana/templates/poddisruptionbudget.yaml b/stable/grafana/templates/poddisruptionbudget.yaml new file mode 100644 index 0000000000..60f58bf76b --- /dev/null +++ b/stable/grafana/templates/poddisruptionbudget.yaml @@ -0,0 +1,25 @@ +{{- if .Values.podDisruptionBudget }} +apiVersion: policy/v1beta1 +kind: PodDisruptionBudget +metadata: + name: {{ template "grafana.name" . }} + labels: + app: {{ template "grafana.name" . }} + chart: {{ template "grafana.chart" . }} + release: {{ .Release.Name }} + heritage: {{ .Release.Service }} +{{- if .Values.labels }} +{{ toYaml .Values.labels | indent 4 }} +{{- end }} +spec: +{{- if .Values.podDisruptionBudget.minAvailble }} + minAvailable: {{ .Values.podDisruptionBudget.minAvailble }} +{{- end }} +{{- if .Values.podDisruptionBudget.maxUnavailable }} + maxUnavailable: {{ .Values.podDisruptionBudget.maxUnavailable }} +{{- end }} + selector: + matchLabels: + app: {{ template "grafana.name" . }} + release: {{ .Release.Name }} +{{- end }} diff --git a/stable/grafana/values.yaml b/stable/grafana/values.yaml index 44d66b4cde..451e43f418 100644 --- a/stable/grafana/values.yaml +++ b/stable/grafana/values.yaml @@ -18,6 +18,12 @@ serviceAccount: replicas: 1 +## See `kubectl explain poddisruptionbudget.spec` for more +## ref: https://kubernetes.io/docs/tasks/run-application/configure-pdb/ +podDisruptionBudget: {} +# minAvailble: 1 +# maxUnavailable: 1 + ## See `kubectl explain deployment.spec.strategy` for more ## ref: https://kubernetes.io/docs/concepts/workloads/controllers/deployment/#strategy deploymentStrategy: