Просмотр исходного кода

feat(helm): add envFromSecret (#5778)

* (feature): Adding EnvFrom a specified file

* (update): Update values.yaml with envFrom

* (doc) : update readme with envFromSecret
Paulus Lucas 4 лет назад
Родитель
Сommit
a99e54a6a2

+ 1 - 0
deploy/charts/emqx/README.md

@@ -37,6 +37,7 @@ The following table lists the configurable parameters of the emqx chart and thei
 | `image.repository` | EMQ X Image name |emqx/emqx|
 | `image.pullPolicy`  | The image pull policy  |IfNotPresent|
 | `image.pullSecrets `  | The image pull secrets  |`[]` (does not add image pull secrets to deployed pods)|
+| `envFromSecret` | The name pull a secret in the same kubernetes namespace which contains values that will be added to the environment | nil |
 | `recreatePods` | Forces the recreation of pods during upgrades, which can be useful to always apply the most recent configuration. | false |
 | `persistence.enabled` | Enable EMQX persistence using PVC |false|
 | `persistence.storageClass` | Storage class of backing PVC |`nil` (uses alpha storage class annotation)|

+ 4 - 0
deploy/charts/emqx/templates/StatefulSet.yaml

@@ -114,6 +114,10 @@ spec:
           envFrom:
             - configMapRef:
                 name: {{ include "emqx.fullname" . }}-env
+         {{- if .Values.envFromSecret }}
+            - secretRef:
+                name: {{ .Values.envFromSecret }}
+         {{- end }}
           env:
           - name: EMQX_NAME
             value: {{ .Release.Name }}

+ 7 - 0
deploy/charts/emqx/values.yaml

@@ -14,6 +14,13 @@ image:
   # pullSecrets:
   # - myRegistryKeySecretName
 
+
+# The name of a secret in the same kubernetes namespace which contains values to
+# be added to the environment (must be manually created)
+# This can be useful for passwords and logins, etc.
+
+# envFromSecret: "emqx-secrets"
+
 ## 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