diff --git a/deploy/charts/x509-certificate-exporter/README.md b/deploy/charts/x509-certificate-exporter/README.md index 2cd3757..8cc9802 100644 --- a/deploy/charts/x509-certificate-exporter/README.md +++ b/deploy/charts/x509-certificate-exporter/README.md @@ -390,6 +390,7 @@ hostPathsExporter: | secretsExporter.excludeLabels | list | `[]` | Exclude TLS Secrets having these labels. Items can be keys such as `my-label` or also require a value with syntax `my-label=my-value`. | | secretsExporter.cache.enabled | bool | `true` | Enable caching of Kubernetes objects to prevent scraping timeouts | | secretsExporter.cache.maxDuration | int | `300` | Maximum time an object can stay in cache unrefreshed (seconds) - it will be at least half of that | +| secretsExporter.env | list | `[]` | Additional environment variables for container | | hostPathsExporter.debugMode | bool | `false` | Should debug messages be produced by hostPath exporters (default for all hostPathsExporter.daemonSets) | | hostPathsExporter.restartPolicy | string | `"Always"` | restartPolicy for Pods of hostPath exporters (default for all hostPathsExporter.daemonSets) | | hostPathsExporter.updateStrategy | object | `{}` | updateStrategy for DaemonSet of hostPath exporters (default for all hostPathsExporter.daemonSets) | @@ -408,6 +409,7 @@ hostPathsExporter: | hostPathsExporter.watchDirectories | list | `[]` | [SEE README] List of directory paths of the host to scan for PEM encoded certificate files to be watched and exported as metrics (one level deep) | | hostPathsExporter.watchFiles | list | `[]` | [SEE README] List of file paths of the host for PEM encoded certificates to be watched and exported as metrics (one level deep) | | hostPathsExporter.watchKubeconfFiles | list | `[]` | [SEE README] List of Kubeconf file paths of the host to scan for embedded certificates to export metrics about | +| hostPathsExporter.env | list | `[]` | Additional environment variables for container | | hostPathsExporter.daemonSets | object | `{}` | [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.*`. | | podListenPort | int | `9793` | TCP port to expose Pods on (whether kube-rbac-proxy is enabled or not) | | hostNetwork | bool | `false` | Enable hostNetwork mode. Useful when Prometheus is deployed outside of the Kubernetes cluster | 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..7501efe 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: {}