-
Notifications
You must be signed in to change notification settings - Fork 174
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
Annotation vault.hashicorp.com/auth-config
values are overridden
#456
Comments
vault.hashicorp.com/auth-config
values are overridden by codevault.hashicorp.com/auth-config
values are overridden
Hi @mrjoelkamp, can you include all the annotations that would be used in your example application? I think I understand the issue, but want to make sure I have the full picture. |
@tvoran yes, here is an example of all the annotations for an example app using this: vault.hashicorp.com/agent-inject: "true"
vault.hashicorp.com/role: example-app-kubernetes-ro
vault.hashicorp.com/agent-run-as-user: "1337"
vault.hashicorp.com/agent-run-as-group: "1337"
vault.hashicorp.com/agent-inject-secret-config.toml: secret_v2/example/app/secret
vault.hashicorp.com/agent-inject-template-config.toml: |
[example]
{{- with secret "secret_v2/example/app/secret" }}
example_secret = "{{ .Data.data.example_secret }}"
{{- end }}
vault.hashicorp.com/auth-config-token-path: /var/run/secrets/kubernetes.io/serviceaccount When inspecting the resulting This causes the Vault agent authentication to fail because it isn't using the correct ServiceAccount token. |
Gotcha, yeah I think this is because |
Yes exactly, I wrote that it selects the first volume mount it finds with a code snippet in the summary of the issue. I've used the |
Fixed in #457 |
Describe the bug
Both of the following annotations get overridden by code when specifying the
role
andtoken-path
using the vault.hashicorp.com/auth-config annotation:vault.hashicorp.com/auth-config-token-path
vault.hashicorp.com/auth-config-role
vault-k8s/agent-inject/agent/annotations.go
Lines 865 to 879 in 4f81d9d
Specifically, when more than one ServiceAccount volume is mounted to the pod and the
agent.go
code selects the first volume mount containing the stringserviceaccount
.vault-k8s/agent-inject/agent/agent.go
Lines 767 to 777 in 4f81d9d
Need the ability to explicitly set the correct
token_path
.To Reproduce
Steps to reproduce the behavior:
VAULT_CONFIG
and see that thetoken_path
is not assigned to the specified path but the mounted service account volume path when a Service Account volume mount existsExpected behavior
When using the vault.hashicorp.com/auth-config annotation, I expect that the values are not overridden.
Environment
The text was updated successfully, but these errors were encountered: