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 secret injection with HashiCorp Vault #595

Open
simonostendorf opened this issue Jan 4, 2024 · 2 comments · May be fixed by #652
Open

Support secret injection with HashiCorp Vault #595

simonostendorf opened this issue Jan 4, 2024 · 2 comments · May be fixed by #652
Labels
enhancement New feature or request pinned

Comments

@simonostendorf
Copy link
Contributor

simonostendorf commented Jan 4, 2024

I would like to see support for HashiCorp Vault.
More specifically, the Vault Agent Injector, which can inject secrets from Vault into pods.

To do this, HCCM must either read the HCLOUD_TOKEN from a file or enable the sourcing of a file before startup (so that injecting environment variables via vault is possible, see https://developer.hashicorp.com/vault/docs/platform/k8s/injector/examples#environment-variable-example).

Another solution would be to use the Vault Secrets Operator, which synchronises Vault Secrets with Kubernetes Secrets. However, I think loading on pod startup is better (because it can use the pod service account. This can also be done with the VSO but this requires 2 CRDs for each secret that should be loaded (VaultAuth and VaultStaticSecret))

What do the developers and the community think about this change?

@jooola jooola added the enhancement New feature or request label Jan 4, 2024
@simonostendorf
Copy link
Contributor Author

simonostendorf commented May 17, 2024

I managed to enable vault secret injection via vault-injector by creating my own helm chart for the hcloud-cloud-controller-manager.

The current helm chart doesn't support command customization (I need to run source /vault/secrets/token before calling the hccm binary).

I also added podLabels and podAnnotations to the chart to add vault.hashicorp.com/agent-inject: 'true' and so on to the pod (and not to all resources that are deployed by the chart).

Maybe these changes can be applied to the upstream (your) chart, but i know that adding customized startup command is very specific and not needed by many users.

Edit: Changes can be seen here: https://github.com/simonostendorf/hetznercloud-hcloud-cloud-controller-manager/tree/feat/custom-labels-annotations-commands

@simonostendorf
Copy link
Contributor Author

simonostendorf commented May 22, 2024

The other option could be reading the HCLOUD_TOKEN from a file, that was placed inside the container from the vault-injector. This would avoid the use of custom source command.

What do you think about this?

@simonostendorf simonostendorf linked a pull request May 29, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request pinned
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants