Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(helm) env value to deployment and deamonset #228

Merged
merged 3 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions deploy/charts/x509-certificate-exporter/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
Expand All @@ -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 |
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions deploy/charts/x509-certificate-exporter/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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: {}

Expand Down