I’m currently trying to run MongoDB replicaset with Helm chart and Consul Connect. For initiating the cluster I need to specify all the nodes in the cluster (with rs.initiate()
), but I cannot find a simple way to address/query those nodes through Consul DNS. The only way I’ve found is to mark the Consul node (k8s pod) with tag which I named after pod’s hostname, so I can query them with TAG.serviceName.service.consul. But that also means I cannot use connect-inject anymore, but I have to run separated sidecar with consul next to my main pod. This way seems a little bit dirty for me and I would ask you to come up with some better idea than this. E. g. add the consul tag after running a pod, when the hostname is known or something like that.