hashicorp / hashicorp/consul-template

vault.hashicorp.com/agent-configmap

Open
#1,702 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Go
Stars
4.8k
Forks
801
Avg merge
4h 5m
Merged PRs (30d)
6

Description

After vault is integrated with k8s, secret data can be obtained from vault service in the form of annotation or configmap.
Everything works fine when using annotations. I customized the storage path as /vault/signserverEnv instead of the default path /vault/secrets.
```
vault.hashicorp.com/agent-inject-secret-ManagementCA.crt: secret/data/Dev/Security/signserver/config
vault.hashicorp.com/secret-volume-path-ManagementCA.crt: /vault/signserverEnv
vault.hashicorp.com/agent-inject-template-ManagementCA.crt: |
{{- with secret "secret/data/Dev/Security/signserver/config" -}}
{{base64Decode .Data.data.ManagementCA}}
{{- end -}}

```

But when I use configmap
` vault.hashicorp.com/agent-configmap: vault-template-config`

The configuration of config is as follows
```
"auto_auth" = {
"method" = {
"type" = "kubernetes"
"config" = {
"role" = "signserverdev"
}
}
}
"exit_after_auth" = true
"template" = {
"perms" ="0777"
"destination" = "/vault/signserverEnv/ManagementCA.crt"
"contents" = "{{- with secret \"secret/data/Dev/Security/signserver/config\" -}}{{base64Decode .Data.data.ManagementCA}}{{- end -}}"
}
```
Report the following error message
![image](https://user-images.githubusercontent.com/52235796/212289694-bc2ec6e3-6247-4005-9bc3-bd33fbb8c495.png)
This shows that there is no permission to create, I checked[vault agent template document](https://developer.hashicorp.com/vault/docs/agent/template#template-configurations),find `create_dest_dirs`(default true)and`perms`(Already set to 0777)might solve the problem, but unfortunately also got the error above. Can you help me how to set it up? (The boss is very angry now)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.