![]() To use a secret in an environment variable in a pod: The program in a container is responsible for reading the secrets from the files. ![]() We can see inside the container that mounts a secret volume, the secret keys appear as files and the secret values are base-64 decoded and stored inside these files. ![]() $ kubectl exec mypod cat /etc/foo/password $ kubectl exec mypod cat /etc/foo/username spec.volumes.Ĭreate the pod and check if our volume for the secret is properly mounted: This is an example of a pod ( mysecret-pod.yaml) that mounts a secret in a volume:Įach secret we want to use needs to be referred to in. Each key in the secret data map becomes the filename under mountPath.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
May 2023
Categories |