-
Notifications
You must be signed in to change notification settings - Fork 880
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
Add postStart lifecycle hook #315
Conversation
Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
This is a great feature, will more documentation be provided? For example, I have a ConfigMap that creates a script to set a bunch of default auth policies. The script is written to userconfig properly using extraVolumes, but the permissions are set to root so the postStart can not execute the script as permission is denied. Any additional examples would be awesome! |
Hi @davidcunningham, Something like this should work for you (it's a little ugly): server:
extraVolumes:
- type: secret
name: demo-vault
readinessProbe:
path: "/v1/sys/health?standbyok=true&sealedcode=204&uninitcode=204"
postStart:
- "/bin/sh"
- "-c"
- "sleep 5 && cp /vault/userconfig/demo-vault/bootstrap.sh /tmp/bootstrap.sh && chmod +x /tmp/bootstrap.sh && /tmp/bootstrap.sh" We need to add a feature that will allow users to set the mode for the files being mounted. That should make this nicer. |
Thanks @jasonodonnell. It's a prettier solution then having a bunch of commands in the postStart! |
* Add postStart lifecycle hook * Update values.yaml Co-authored-by: Theron Voran <tvoran@users.noreply.github.com> Co-authored-by: Theron Voran <tvoran@users.noreply.github.com>
Hey @jasonodonnell , thanks for your great work on this feature.
|
@jasonodonnell I'm trying to find a way to run a script for enable transit for auto-unseal. |
This adds a configurable
postStart
lifecycle hook to Vault Helm. Using this hook, in conjunction with readiness probe configurations, it's possible to run scripts on the Vault pods after they start. This would allow users to create custom scripts to do things like initialize Vault and bootstrap auth methods/policies.These can also be configured via
--set
: