<p>Using <a href="https://helm.dask.org/" rel="nofollow noreferrer">Helm</a>, I've created a Dask cluster.</p>

<pre><code>NAME                               READY   STATUS    RESTARTS   AGE
dask01-jupyter-aaa-aaaa            1/1     Running   0          3d19h
dask01-scheduler-bbb-bbbb          1/1     Running   0          3d19h
dask01-worker-ccc-cccc             1/1     Running   0          3d19h
dask01-worker-ddd-dddd             1/1     Running   0          3d19h
dask01-worker-eee-eeee             1/1     Running   0          3d19h
</code></pre>

<p>I can run a basic Dask workload.</p>

<pre class="lang-py prettyprint-override"><code>import dask.array as da

array = da.ones((1000, 1000, 1000), chunks=(100, 100, 10))
</code></pre>

<p>Now, I would like to connect it to a client somehow:</p>

<pre class="lang-py prettyprint-override"><code>from dask import distributed

cluster = None # TODO: configure KubeCluster somehow https://kubernetes.dask.org/en/latest/
client = distributed.Client(cluster)
</code></pre>

<p>This works if I want to <a href="https://kubernetes.dask.org/en/latest/#quickstart" rel="nofollow noreferrer">launch a cluster</a>:</p>

<pre class="lang-py prettyprint-override"><code>from dask_kubernetes import KubeCluster

cluster = KubeCluster.from_yaml('worker-spec.yml')
</code></pre>

<p>But how do I connect to an existing cluster?</p>

<p>The Dask Helm Chart and <code>dask-kubernetes</code> are two separate projects which work in different ways. They are not compatible together.</p>

<p>If you are using the Jupyter Notebook which is created as part of the Helm Chart then everything is already configured for you and you can create a Dask client with default options.</p>

<pre class="lang-py prettyprint-override"><code>from distributed import Client
client = Client()
</code></pre>

<p>If you wish to use a different Python environment, such as the one on your local machine, you must specify the remote address of the scheduler. This will vary depending on how you configured your Helm Chart. </p>

<p>If you exposed your scheduler via a load balancer for example you need to point your client to it.</p>

<pre class="lang-py prettyprint-override"><code>from distributed import Client
client = Client('tcp://&lt;load balancer ip&gt;:8786')
</code></pre>

<p>If you get the status of your Helm Chart deployment it will show you information on how to connect to the scheduler in the printed notes.</p>

<pre class="lang-sh prettyprint-override"><code>helm status &lt;depoyment name&gt;
</code></pre>
