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

Support setting autopilot_redundancy_zone in the Vault configuration file #1053

Open
c4po opened this issue Aug 21, 2024 · 1 comment
Open
Labels
enhancement New feature or request

Comments

@c4po
Copy link

c4po commented Aug 21, 2024

Is your feature request related to a problem? Please describe.

I'd like to request a feature to support setting the autopilot_redundancy_zone in the Vault configuration file using the Vault Helm chart.

Currently, the Vault Helm chart doesn't provide a way to set this configuration parameter, which is important for high availability setups.

Describe the solution you'd like
in the _helpers.tpl we have vault.args defined like this

{{- define "vault.args" -}}
  {{ if or (eq .mode "standalone") (eq .mode "ha") }}
          - |
            cp /vault/config/extraconfig-from-values.hcl /tmp/storageconfig.hcl;
            [ -n "${HOST_IP}" ] && sed -Ei "s|HOST_IP|${HOST_IP?}|g" /tmp/storageconfig.hcl;
            [ -n "${POD_IP}" ] && sed -Ei "s|POD_IP|${POD_IP?}|g" /tmp/storageconfig.hcl;
            [ -n "${HOSTNAME}" ] && sed -Ei "s|HOSTNAME|${HOSTNAME?}|g" /tmp/storageconfig.hcl;
            [ -n "${API_ADDR}" ] && sed -Ei "s|API_ADDR|${API_ADDR?}|g" /tmp/storageconfig.hcl;
            [ -n "${TRANSIT_ADDR}" ] && sed -Ei "s|TRANSIT_ADDR|${TRANSIT_ADDR?}|g" /tmp/storageconfig.hcl;
            [ -n "${RAFT_ADDR}" ] && sed -Ei "s|RAFT_ADDR|${RAFT_ADDR?}|g" /tmp/storageconfig.hcl;
            /usr/local/bin/docker-entrypoint.sh vault server -config=/tmp/storageconfig.hcl {{ .Values.server.extraArgs }}
   {{ else if eq .mode "dev" }}
          - |
            /usr/local/bin/docker-entrypoint.sh vault server -dev {{ .Values.server.extraArgs }}
  {{ end }}
{{- end -}}

we just need add a new sed command to replace {redundancy_zone} with the environment variable.

so we can have an init container to set this value or can be set with extraEnvironmentVars in values file.

Describe alternatives you've considered
add a tool like envsubst to replace all the variable in the config file.

Additional context
Add any other context or screenshots about the feature request here.

@c4po c4po added the enhancement New feature or request label Aug 21, 2024
@c4po
Copy link
Author

c4po commented Aug 21, 2024

like the IP address and hostname, the REDUANCY_ZONE value also can only be determined at run time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant