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

add support for setting "command" on templates #56

Closed
joemiller opened this issue Jan 23, 2020 · 0 comments
Closed

add support for setting "command" on templates #56

joemiller opened this issue Jan 23, 2020 · 0 comments
Labels
enhancement New feature or request injector Area: mutating webhook service

Comments

@joemiller
Copy link
Contributor

joemiller commented Jan 23, 2020

Use case: Need to run a command (eg: send SIGHUP) when secrets are updated.

A useful example is nginx and fetching mTLS certs from Vault. After the cert is updated we need to send a SIGHUP to trigger nginx to reload the certs.

It looks like this is currently possible using the configmap escape hatch but this is a common enough case for us that having to use the configmap approach is significant friction.

Example of how this might look as annotations:

        vault.hashicorp.com/agent-inject-secret-tls.pem: "pki/issue/ou-nobody"
        vault.hashicorp.com/agent-inject-template-tls.pem: |
           {{- with secret "pki/issue/ou-nobody" "common_name=foo.example.com" "ttl=5m" }}
           {{ .Data.private_key }}
           {{ .Data.certificate }}
           {{ .Data.issuing_ca }}
           {{ end }}
        vault.hashicorp.com/agent-inject-command-tls.pem: "/bin/sh -c 'pkill -HUP nginx || true'"

  spec:
    # shared PID namespace so the vault-agent sidecar can send signals to nginx in the app container
    shareProcessNamespace: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request injector Area: mutating webhook service
Projects
None yet
Development

No branches or pull requests

3 participants