How to access pods in same node? (Helm)

6/19/2020

I have two charts in helm.

Chart A (service.type=LoadBalancer)
Chart B (service.type=NodePort)

Env of Chart A has uri of Chart B

Env of Chart B has uri of Chart A

When I install Chart A with env (URI of chart B), it gives dynamic node ip and node port for chart A. Then I install Chart B with env (URI of chart A), it gives dynamic node ip and node port for chart B.

But old node ip and node port of Chart B is present in the chart A env.

If I update it in chart A env and reinstall, it gives new dynamic node ip and node port for chart A which is not present in chart B.

Is there any possible way to resolve this issue?

-- vignesh5698
helm-tls
helmfile
kubernetes
kubernetes-helm
kubernetes-pod

1 Answer

6/19/2020

Instead of using the IP address as env, use the service's DNS address.

Let's say, Chart-A has a service named service-A on namespace demo. You can connect to service-A from any namespace of the cluster on service-A.demo.svc. You don't need to worry while upgrading or reinstalling Chart-A, just make sure that the service's name remains the same.

URL formal: <service-name>.<namespace>.svc:PORT

-- Kamol Hasan
Source: StackOverflow