-
I have nats server running in k8 with tls enabled and tls certificate is created by lets-encrypt with our domain name, for communication from outside the server, providing domain name is nats connection is working given below. In my use case, i have multiple pod inside the same k8 node, wants to connect to nats server, for now i am giving the same url above to connect, but the problem is everytime i have to provide the host aliasing to pod specifying the domain name and my server ip address. In kubernetes u can connect to the pods using it service name, and i was trying to do that, but the problem, tls certificate it is checking the dns name, suppose if we give the connection url as i am getting the error the above mentioned scenario sounds like a frequent scenario, because for internal k8 communication, i dont want the communication to go outside, (if we provide the domain name) Is there any configuration in nats i am missing, or this is not possible for current nats server? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Hi you need to add your k8s service url in certificate SAN list. |
Beta Was this translation helpful? Give feedback.
What you can also do is to use two certs, one for public traffic and one for internal traffic then setup both in the tls config block:
if you want to use the Let's Encrypt certs for internal traffic then you could set an dns entry to resolves to an static cluster ip, for example with a nats deployment like this: