hashicorp / hashicorp/vault-helm
easy way to get environment variables from a ConfigMap
- Dominant language
- Shell
- Stars
- 1.3k
- Forks
- 898
- Avg merge
- 3d 1h
- Merged PRs (30d)
- 1
Description
**Is your feature request related to a problem? Please describe.**
I want to configure some things in Vault by using environment variables that differ between instances. These are not secrets, so they don't belong in `server.extraSecretEnvironmentVars`, but I also don't want to hard-code them into `values.yaml` in `server.extraEnvironmentVars`, or have to put them on the command-line with `--set` each time I deploy.
**Describe the solution you'd like**
My preference would be to put the variables into a ConfigMap and have the Vault Helm chart pull from that. For instance, the Datadog Helm chart [lets you do this](https://github.com/DataDog/helm-charts/blob/ed21db9d78ef2c8c6bdffb696b0cfa3564925a9f/charts/datadog/values.yaml#L311-L317):
```yaml
envFrom:
- configMapRef
name: config-map-name
```
where
```yaml
apiVersion: v1
kind: ConfigMap
metadata:
name: config-map-name
data:
ENV_VAR_1: value_1
ENV_VAR_2: value_2
```
**Describe alternatives you've considered**
Put the HCL that configures the same thing into a ConfigMap, mount it, and point Vault at that. This should work, but is also much more verbose. For example,
```yaml
volumes:
- name: extra-env
configMap:
name: extra-env
items:
- key: config
path: config.hcl
volumeMounts:
- mountPath: /vault/userconfig/extra-env
- name: extra-env
extraArgs: "-c /vault/userconfig/extra-env/config.hcl"
```
and if there's any reason why merging that config file with the main one doesn't do what you want, then you're out of luck. For instance, what happens if you've got multiple `storage` stanzas, each with a different part of the config?
Contributor guide
Research direction
Start by reading how the chart handles server.extraEnvironmentVars and server.extraSecretEnvironmentVars, then compare the requested ConfigMap envFrom pattern with the linked Datadog values.yaml example. Done should be a documented chart option that lets users source non-secret environment variables from a ConfigMap without hard-coding them or using --set.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- helm, kubernetes
- Domain
- devops
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100