# Ray and Jupyter Lab on K8

**URL:** <https://discuss.ray.io/t/ray-and-jupyter-lab-on-k8/587>\
**Category:** Kubernetes\
**Created:** [January 25, 2021, 11:18pm UTC](https://discuss.ray.io/t/ray-and-jupyter-lab-on-k8/587 "2021-01-25T23:18:54Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![ecorro](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/ecorro/32/4712_2.png) [@ecorro](https://discuss.ray.io/u/ecorro)\
**Post date:** [January 25, 2021, 11:18pm UTC](https://discuss.ray.io/t/ray-and-jupyter-lab-on-k8/587/1 "2021-01-25T23:18:54Z")

</div>

Hi! I just deployed ray, version 2.0.0.dev0 on Kubernetes. I followed the instructions from [Deploying on Kubernetes — Ray v2.0.0.dev0](https://docs.ray.io/en/master/cluster/kubernetes.html) and tried to run ipython using the recommended commands:  
_# From your local machine._  
_$ kubectl -n ray exec -it ray-head- – ipython_

_# From a remote shell on the head node._  
_$ kubectl -n ray exec -it ray-head- – bash_  
_root@ray-head-6f566446c-5rdmb:/# ipython_

However, the IPython binaries are not in Ray’s head container.

**I just want to be able to use the Ray cluster to run jobs launched from a Jupyterlab notebook. I’m expecting something like opening a cluster session similar to what can be done with PySpark.**

I’d appreciate your guidance on this. Thanks in advance. Enrique

---

<div class="post-metadata">

**Author:** ![rliaw](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/rliaw/32/24_2.png) [@rliaw](https://discuss.ray.io/u/rliaw)\
**Post date:** [January 26, 2021, 3:16am UTC](https://discuss.ray.io/t/ray-and-jupyter-lab-on-k8/587/2 "2021-01-26T03:16:52Z")

</div>

@ecorro could you try setting up the Ray Client?

[https://docs.ray.io/en/master/ray-client.html#basic-usage](https://docs.ray.io/en/master/ray-client.html#basic-usage)

You should be able to just do the following:

1. Start a ray cluster
2. Run `python -m ray.util.client.server` on the `ray-head`
3. Then open a jupyter notebook (from a machine that has access to port 50051 of the head node), and within the jupyter notebook, call `ray.util.connect("head-address:50051")`.

cc @barakmich

---

<div class="post-metadata">

**Author:** ![ecorro](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/ecorro/32/4712_2.png) [@ecorro](https://discuss.ray.io/u/ecorro)\
**Post date:** [January 26, 2021, 3:18am UTC](https://discuss.ray.io/t/ray-and-jupyter-lab-on-k8/587/3 "2021-01-26T03:18:19Z")

</div>

Thanks @rliaw! I will try that and let you know how it goes.

---

<div class="post-metadata">

**Author:** ![ecorro](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/ecorro/32/4712_2.png) [@ecorro](https://discuss.ray.io/u/ecorro)\
**Post date:** [January 26, 2021, 10:37pm UTC](https://discuss.ray.io/t/ray-and-jupyter-lab-on-k8/587/4 "2021-01-26T22:37:45Z")

</div>

_I got this error: AttributeError: module ‘ray.util’ has no attribute ‘connect’_. I have ray 1.1.0 in my laptop. I wonder if this _connect_ method is new to ray 2.0. Thanks

---

<div class="post-metadata">

**Author:** ![rliaw](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/rliaw/32/24_2.png) [@rliaw](https://discuss.ray.io/u/rliaw)\
**Post date:** [January 26, 2021, 10:51pm UTC](https://discuss.ray.io/t/ray-and-jupyter-lab-on-k8/587/5 "2021-01-26T22:51:28Z")

</div>

Yeah, could you try installing from the latest ray nightly wheels? [Installing Ray — Ray v2.0.0.dev0](https://docs.ray.io/en/master/installation.html)

---

<div class="post-metadata">

**Author:** ![valiantljk](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/valiantljk/32/252_2.png) [@valiantljk](https://discuss.ray.io/u/valiantljk)\
**Post date:** [January 27, 2021, 10:33pm UTC](https://discuss.ray.io/t/ray-and-jupyter-lab-on-k8/587/6 "2021-01-27T22:33:06Z")

</div>

besides connecting to ray.client, is there other API supported by ray client? e.g., querying job status
