Hello everyone,
I have a simple deployment with 1 main Pod and 1 InitContainer.
I successfully installed the vault in K8s, and my deployment without the init container works fine.
This is the template. annotations
of my deployment:
vault.hashicorp.com/agent-inject: 'true'
vault.hashicorp.com/tls-skip-verify: 'true'
vault.hashicorp.com/agent-inject-status: 'update'
vault.hashicorp.com/role: 'digify'
vault.hashicorp.com/agent-inject-secret-backend: "secret/digify/backend"
vault.hashicorp.com/agent-inject-template-backend: |
{{- with secret "secret/digify/backend" -}}
{
"pass": "{{ .Data.data.pass }}"
}
{{- end }}
But the problem is my init container is using this same secret, and I want to pass it to the init container too.
But apparently, this doesn’t automatically inject secret to the init containers (only main and sidecar containers)
How can I pass it on to the init containers too?