In this post, we will see how to resolve How to mount Vault secret as a file in Kubernetes?
Question:
I’m using Hashicorp Vault in Kubernetes. I’m trying to mount secret file into main folder where my application resides. It would look like that:/usr/share/nginx/html/.env
while application files are in /usr/share/nginx/html
. But the container is not starting because of that. I suspect that that /usr/share/nginx/html
was overwritten by Vault (annotation: vault.hashicorp.com/secret-volume-path
). How can I mount only file /usr/share/nginx/html/.env
?My annotations:
Best Answer:
I tried to replicate the use case, but I got an error.env
in the path, here is the configcommand
of the desired container, for this use case, i used nginx
my-app
If you have better answer, please add a comment about this, thank you!
Source: Stackoverflow.com
Leave a Review