From c0f936baa8b636ebcca5f530cade6ab538307120 Mon Sep 17 00:00:00 2001 From: Piotr Rotter Date: Tue, 9 Jan 2024 10:52:36 +0100 Subject: [PATCH] feat(helm) env value to deployment and deamonset --- .../x509-certificate-exporter/templates/daemonset.yaml | 5 +++++ .../templates/deployment.yaml | 4 ++++ deploy/charts/x509-certificate-exporter/values.yaml | 10 ++++++++++ 3 files changed, 19 insertions(+) diff --git a/deploy/charts/x509-certificate-exporter/templates/daemonset.yaml b/deploy/charts/x509-certificate-exporter/templates/daemonset.yaml index 100e317..0385770 100644 --- a/deploy/charts/x509-certificate-exporter/templates/daemonset.yaml +++ b/deploy/charts/x509-certificate-exporter/templates/daemonset.yaml @@ -2,6 +2,7 @@ {{- range $dsName, $dsDef := . }} {{- $extraVolumes := concat ( default $.Values.hostPathsExporter.extraVolumes $dsDef.extraVolumes ) $.Values.extraVolumes }} {{- $extraVolumeMounts := concat ( default $.Values.hostPathsExporter.extraVolumeMounts $dsDef.extraVolumeMounts ) $.Values.extraVolumeMounts }} +{{- $extraEnvs := concat (default (list) $.Values.hostPathsExporter.env) (default (list) $dsDef.env) }} --- apiVersion: apps/v1 kind: DaemonSet @@ -70,6 +71,10 @@ spec: {{- end }} image: {{ include "x509-certificate-exporter.image" $ }} imagePullPolicy: {{ $.Values.image.pullPolicy }} + {{- if $extraEnvs }} + env: + {{- toYaml $extraEnvs | trim | nindent 8 }} + {{- end }} args: {{- with default $.Values.hostPathsExporter.debugMode $dsDef.debugMode }} - --debug diff --git a/deploy/charts/x509-certificate-exporter/templates/deployment.yaml b/deploy/charts/x509-certificate-exporter/templates/deployment.yaml index 973b4f8..7c27897 100644 --- a/deploy/charts/x509-certificate-exporter/templates/deployment.yaml +++ b/deploy/charts/x509-certificate-exporter/templates/deployment.yaml @@ -90,6 +90,10 @@ spec: readOnly: true {{- end }} {{- end }} + {{- if .Values.secretsExporter.env }} + env: + {{- toYaml .Values.secretsExporter.env | trim | nindent 8 }} + {{- end }} args: {{- if .Values.secretsExporter.debugMode }} - --debug diff --git a/deploy/charts/x509-certificate-exporter/values.yaml b/deploy/charts/x509-certificate-exporter/values.yaml index 3bd6074..ae8920c 100644 --- a/deploy/charts/x509-certificate-exporter/values.yaml +++ b/deploy/charts/x509-certificate-exporter/values.yaml @@ -127,6 +127,11 @@ secretsExporter: # -- Maximum time an object can stay in cache unrefreshed (seconds) - it will be at least half of that maxDuration: 300 + # -- Additional environment variables for container + env: [] + #- name: GOMAXPROCS + # value: "1" + hostPathsExporter: # -- Should debug messages be produced by hostPath exporters (default for all hostPathsExporter.daemonSets) debugMode: false @@ -180,6 +185,11 @@ hostPathsExporter: # -- [SEE README] List of Kubeconf file paths of the host to scan for embedded certificates to export metrics about watchKubeconfFiles: [] + # -- Additional environment variables for container + env: [] + #- name: GOMAXPROCS + # value: "1" + # -- [SEE README] Map to define one or many DaemonSets running hostPath exporters. Key is used as a name ; value is a map to override all default settings set by `hostPathsExporter.*`. daemonSets: {}