From 7a99a1e322ec0f0e53994b1704031c2574093666 Mon Sep 17 00:00:00 2001 From: Lyle Franklin Date: Mon, 10 Dec 2018 15:54:40 -0800 Subject: [PATCH] Add configurable `podAnnotations` to unifi chart (#9833) Use case is using `ark` + `restic` to take backups which requires pods with persistent data to be annotated like: ``` kubectl annotate pod unifi-55f6dcc44c-khbrk backup.ark.heptio.com/backup-volumes=unifi-data ``` Signed-off-by: Lyle Franklin --- charts/unifi/Chart.yaml | 2 +- charts/unifi/README.md | 1 + charts/unifi/templates/deployment.yaml | 6 ++++++ charts/unifi/values.yaml | 2 ++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/charts/unifi/Chart.yaml b/charts/unifi/Chart.yaml index 345480d2..a34a8bd2 100644 --- a/charts/unifi/Chart.yaml +++ b/charts/unifi/Chart.yaml @@ -2,7 +2,7 @@ apiVersion: v1 appVersion: 5.9.29 description: Ubiquiti Network's Unifi Controller name: unifi -version: 0.2.1 +version: 0.2.2 keywords: - ubiquiti - unifi diff --git a/charts/unifi/README.md b/charts/unifi/README.md index c25d05a8..5800af5f 100644 --- a/charts/unifi/README.md +++ b/charts/unifi/README.md @@ -88,6 +88,7 @@ The following tables lists the configurable parameters of the Sentry chart and t | `nodeSelector` | Node labels for pod assignment | `{}` | | `tolerations` | Toleration labels for pod assignment | `[]` | | `affinity` | Affinity settings for pod assignment | `{}` | +| `podAnnotations` | Key-value pairs to add as pod annotations | `{}` | Specify each parameter using the `--set key=value[,key=value]` argument to `helm install`. For example, diff --git a/charts/unifi/templates/deployment.yaml b/charts/unifi/templates/deployment.yaml index 3b253e2f..f631c259 100644 --- a/charts/unifi/templates/deployment.yaml +++ b/charts/unifi/templates/deployment.yaml @@ -18,6 +18,12 @@ spec: labels: app: {{ template "unifi.name" . }} release: {{ .Release.Name }} + {{- if .Values.podAnnotations }} + annotations: + {{- range $key, $value := .Values.podAnnotations }} + {{ $key }}: {{ $value | quote }} + {{- end }} + {{- end }} spec: containers: - name: {{ .Chart.Name }} diff --git a/charts/unifi/values.yaml b/charts/unifi/values.yaml index b57e819f..a4def1c9 100644 --- a/charts/unifi/values.yaml +++ b/charts/unifi/values.yaml @@ -151,3 +151,5 @@ nodeSelector: {} tolerations: [] affinity: {} + +podAnnotations: {}