Is this straight Docker or an orchestration system like Nomad, Kubernetes, etc.?
Generally you’d use volume mounts to expose those files into the container - for Kubernetes that would be using secrets, while for straight Docker it would me mounting a path from the underlying server into the container.
Thanks Stuart. Its just Docker. Instead of mounting a path from underlying server onto the container, mapping the container port on to the server port on which https is enabled will also work right?
if i dont map the path from the server into the container for the certificate files and instead just map the port 8200 in the container to the port 443 (i.e the port for which https is enabled on the server) on the server. It should also work right?
You can map the files easily enough as readonly (:ro). For certs I rather map them individually rather than the whole cert directory. I’m just a little paranoid with mapping drives.
Yes, you either have TLS enabled or not on port 8200, 443 it not necessary when you enable TLS on a listener.
Normally you map 443 to 8200 on a load balancer as a TLS pass thru then enable TLS on the 8200 listener. That way it terminates the SSL session on the node.
So then, i can enable https on port 443 on the server and map this to the port 8200 on the container instead of mapping the certificate files on the server to the container.
Make sure 127.0.0.1 is in SAN while generating the SSL cert. In k8s you need to define very pod/container name combo in the SAN list. Ours has like 20 aliases defined.
You can ignore it, but that’s not exactly the best way to do it.
Thanks Aram.This is very helpful.
Since vault is running inside the container, in the vault config file can i define the api and cluster addr as below or should i use the docker host domain name