# For the K8s ray cluster with ray opeartor setup. Why is ray.init(address='headIP:port') not allowed at the kuberenets job pod?

**URL:** <https://discuss.ray.io/t/for-the-k8s-ray-cluster-with-ray-opeartor-setup-why-is-ray-init-address-headip-port-not-allowed-at-the-kuberenets-job-pod/2854>\
**Category:** Kubernetes\
**Created:** [July 9, 2021, 5:32pm UTC](https://discuss.ray.io/t/for-the-k8s-ray-cluster-with-ray-opeartor-setup-why-is-ray-init-address-headip-port-not-allowed-at-the-kuberenets-job-pod/2854 "2021-07-09T17:32:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Amit\_Shil](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/amit_shil/32/1256_2.png) [@Amit\_Shil](https://discuss.ray.io/u/Amit_Shil)\
**Post date:** [July 9, 2021, 5:32pm UTC](https://discuss.ray.io/t/for-the-k8s-ray-cluster-with-ray-opeartor-setup-why-is-ray-init-address-headip-port-not-allowed-at-the-kuberenets-job-pod/2854/1 "2021-07-09T17:32:20Z")

</div>

For the K8s ray cluster with ray opeartor setup. Why does ray.init(address=‘headIP:port’) is not allowed at the kuberenets job pod?

ray.client(address=‘headIP:port’).connect() works fine.  
ray.util.connect(address=‘headIP:port’) works fine.

why not ray.init(address=‘headIP:port’) ?

screenshot will give more details:

 ![image](https://us1.discourse-cdn.com/flex020/uploads/ray/original/2X/4/47493fdad9fabfcbac05e7e481460537c9da8d66.png)

---

<div class="post-metadata">

**Author:** ![Dmitri](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/dmitri/32/657_2.png) [@Dmitri](https://discuss.ray.io/u/Dmitri)\
**Post date:** [July 15, 2021, 4:22am UTC](https://discuss.ray.io/t/for-the-k8s-ray-cluster-with-ray-opeartor-setup-why-is-ray-init-address-headip-port-not-allowed-at-the-kuberenets-job-pod/2854/2 "2021-07-15T04:22:09Z")

</div>

It’s the nature of the API – ray.init starts Ray on a node of the cluster, ray.client().connect and ray.util.connect instantiates a client connection that allows communication with a server on the Ray head node.

In the near future, we’re planning to have ray.init instantiate a client connection if run remotely. (Then you’d get the expected behavior!) The Ray Client is relatively young, but we’re quickly transitioning it to become the standard mode of operation.
