puppetlabs / puppetserver-helm-chart

The Helm Chart for Puppet Server
Apache License 2.0
47 stars 55 forks source link

Extra environment variables from secrets #193

Closed ldaneliukas closed 7 months ago

ldaneliukas commented 8 months ago

Use Case

Currently we can mount extra environment variables to all of the containers that the chart brings up. However, there is no method add environment variables from secrets which could be used in things such as custom entry points.

Describe the Solution You Would Like

Additional value, e.g.:

puppetserver:
  masters:
    extraEnvSecret: "secretName"

This would add the following to the puppetserver container:

{{- if .Values.puppetserver.masters.extraEnvSecret }}
envFrom:
  - secretRef:
    name: {{ .Values.puppetserver.masters.extraEnvSecret }}
{{- end }}

Describe Alternatives You've Considered

I've tried adding secrets via extraSecrets but these aren't mounted to the containers and would still require to parse them in bash (or similar) to retrieve values for specific secrets that I need in my custom entrypoint scripts. Getting them as environment variables would be the proper way.

Additional Context

I can create a PR for this.

Xtigyro commented 8 months ago

Same here - please create a PR if you can. CC: @davidphay