<p>I deployed a Ray cluster on an AKS cluster.
To run my applications leveraging the Ray cluster, currently I'm deploying each of my applications as a classic k8s Deployment object and connecting to the Ray cluster using</p>
<pre><code>ray.init(address=&quot;&lt;head-node-ip:10001&quot;)
</code></pre>
<p>The problem is that I'm manually inserting the head node IP by looking at the head node ip through <code>kubectl describe pod head-node-pod</code>. Is there a way to get it automatically ?</p>
<p>Thanks in advance.</p>

pairon
<p>I think you should be leveraging on <strong>Kubernetes services</strong> and use the <strong>DNS instead of IP</strong>.</p>
<p>so in your case, the DNS would be <code>head-node-svc.your-namespace.svc.cluster.local</code> where head-node-svc is your new service associated with head node pod, your-namespace is your namespace where the pods and services are created, svc stays there as it is and cluster.local is your cluster domain.</p>
