From 72f21f2d559726e0da673f2036ea64cacf6c8b91 Mon Sep 17 00:00:00 2001 From: Rory Z Date: Thu, 16 Jun 2022 13:56:29 +0800 Subject: [PATCH] chore(helm): add pod annotation --- deploy/charts/emqx/README.md | 2 ++ deploy/charts/emqx/templates/StatefulSet.yaml | 5 ++++- deploy/charts/emqx/values.yaml | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/deploy/charts/emqx/README.md b/deploy/charts/emqx/README.md index 8461c4ef6..2c00d86ec 100644 --- a/deploy/charts/emqx/README.md +++ b/deploy/charts/emqx/README.md @@ -40,6 +40,8 @@ Parameter | Description | Default Value `image.pullPolicy` | The image pull policy | `IfNotPresent` `image.pullSecrets ` | The image pull secrets (does not add image pull secrets to deployed pods) |``[]`` `recreatePods` | Forces the recreation of pods during upgrades, which can be useful to always apply the most recent configuration. | `false` +`podAnnotations ` | Annotations for pod | `{}` +`podManagementPolicy`| To redeploy a chart with existing PVC(s), the value must be set to Parallel to avoid deadlock | `Parallel` `persistence.enabled` | Enable EMQX persistence using PVC | `false` `persistence.storageClass` | Storage class of backing PVC (uses alpha storage class annotation) | `nil` `persistence.existingClaim` | EMQX data Persistent Volume existing claim name, evaluated as a template | `""` diff --git a/deploy/charts/emqx/templates/StatefulSet.yaml b/deploy/charts/emqx/templates/StatefulSet.yaml index d405eb9f3..6e21db38e 100644 --- a/deploy/charts/emqx/templates/StatefulSet.yaml +++ b/deploy/charts/emqx/templates/StatefulSet.yaml @@ -56,8 +56,11 @@ spec: version: {{ .Chart.AppVersion }} app.kubernetes.io/name: {{ include "emqx.name" . }} app.kubernetes.io/instance: {{ .Release.Name }} - {{- if .Values.recreatePods }} annotations: + {{- with .Values.podAnnotations }} + {{- toYaml . | nindent 8 }} + {{- end }} + {{- if .Values.recreatePods }} checksum/config: {{ $configData | sha256sum | quote }} {{- end }} spec: diff --git a/deploy/charts/emqx/values.yaml b/deploy/charts/emqx/values.yaml index f2a51e3e4..3d29f0c8b 100644 --- a/deploy/charts/emqx/values.yaml +++ b/deploy/charts/emqx/values.yaml @@ -17,6 +17,8 @@ image: ## Forces the recreation of pods during helm upgrades. This can be useful to update configuration values even if the container image did not change. recreatePods: false +podAnnotations: {} + # Pod deployment policy # value: OrderedReady | Parallel # To redeploy a chart with existing PVC(s), the value must be set to Parallel to avoid deadlock @@ -253,4 +255,4 @@ containerSecurityContext: metrics: enabled: false - type: prometheus \ No newline at end of file + type: prometheus