From a4c64ab9b58a9cd2f0ce20b81c41a1719f9fc60d Mon Sep 17 00:00:00 2001 From: Matt Campbell Date: Tue, 20 Aug 2024 16:30:47 -0400 Subject: [PATCH] feat(kubernetes-ingress): Add Values.controller.extraEnvFrom to deployment and daemonset Analogous to https://github.com/haproxytech/helm-charts/pull/252, but for `kubernetes-ingress` chart. --- kubernetes-ingress/templates/controller-daemonset.yaml | 4 ++++ kubernetes-ingress/templates/controller-deployment.yaml | 4 ++++ kubernetes-ingress/values.yaml | 7 +++++++ 3 files changed, 15 insertions(+) diff --git a/kubernetes-ingress/templates/controller-daemonset.yaml b/kubernetes-ingress/templates/controller-daemonset.yaml index f969aaf..50f31e4 100644 --- a/kubernetes-ingress/templates/controller-daemonset.yaml +++ b/kubernetes-ingress/templates/controller-daemonset.yaml @@ -215,6 +215,10 @@ spec: {{- if .Values.controller.extraEnvs -}} {{- toYaml .Values.controller.extraEnvs | nindent 10 }} {{- end }} + {{- with .Values.controller.extraEnvFrom }} + envFrom: + {{- toYaml . | trim | nindent 12 }} + {{- end }} resources: {{- toYaml .Values.controller.resources | nindent 12 }} {{- if .Values.controller.lifecycle }} diff --git a/kubernetes-ingress/templates/controller-deployment.yaml b/kubernetes-ingress/templates/controller-deployment.yaml index 6375147..d8c662e 100644 --- a/kubernetes-ingress/templates/controller-deployment.yaml +++ b/kubernetes-ingress/templates/controller-deployment.yaml @@ -208,6 +208,10 @@ spec: {{- if .Values.controller.extraEnvs -}} {{- toYaml .Values.controller.extraEnvs | nindent 10 }} {{- end }} + {{- with .Values.controller.extraEnvFrom }} + envFrom: + {{- toYaml . | trim | nindent 12 }} + {{- end }} resources: {{- toYaml .Values.controller.resources | nindent 12 }} {{- if .Values.controller.lifecycle }} diff --git a/kubernetes-ingress/values.yaml b/kubernetes-ingress/values.yaml index bf320a8..720aa36 100644 --- a/kubernetes-ingress/values.yaml +++ b/kubernetes-ingress/values.yaml @@ -521,6 +521,13 @@ controller: # - name: TZ # value: "Etc/UTC" + ## Use envFrom to add env vars from a secret or ConfigMap to the HAProxy container + ## ref: https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/ + extraEnvFrom: [] + ## Example passing the pod IP into a container + # - configMapRef: + # name: ha-env-config + ## Add additional containers extraContainers: [] ## Example sidecar