# Using Dask Gateway to create clusters with different images

**URL:** https://dask.discourse.group/t/using-dask-gateway-to-create-clusters-with-different-images/2245
**Category:** Distributed
**Tags:** dask-gateway
**Created:** [October 8, 2023, 8:28pm UTC](https://dask.discourse.group/t/using-dask-gateway-to-create-clusters-with-different-images/2245 "2023-10-08T20:28:36Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![dcieslak](https://avatars.discourse-cdn.com/v4/letter/d/f4b2a3/32.png) [@dcieslak](https://dask.discourse.group/u/dcieslak)
#### Post date: [October 8, 2023, 8:28pm UTC](https://dask.discourse.group/t/using-dask-gateway-to-create-clusters-with-different-images/2245/1 "2023-10-08T20:28:36Z")

</div>

I have Dask Gateway deployed to my kubernetes environment and am able to specify a custom image for the deployment. The basic example of:

```auto
a = da.random.normal(size=(1000, 1000), chunks=(500, 500))
a.mean().compute()

```

Works. What I would like to do is allow the user to create a cluster with different images/tags from the one configured in the Helm chart for Dask Gateway. It’s not clear to me how I would do that.

Even more basic examples, taken from the Dask Gateway documentation don’t seem to work. For example:

`cluster = gateway.new_cluster(worker_cores=2, environment="tensorflow")`

Gives:

`ValueError: Unknown fields ['environment', 'worker_cores']`

With `dask_gateway. __version__ ` reporting `2023.9.0`

---

<div class="post-metadata">

### Author: ![guillaumeeb](https://yyz1.discourse-cdn.com/flex035/user_avatar/dask.discourse.group/guillaumeeb/32/1613_2.png) [@guillaumeeb](https://dask.discourse.group/u/guillaumeeb)
#### Post date: [October 9, 2023, 1:35pm UTC](https://dask.discourse.group/t/using-dask-gateway-to-create-clusters-with-different-images/2245/2 "2023-10-09T13:35:43Z")

</div>

Hi @dcieslak, welcome to Dask discourse!

In order to implement such functionnality, you want to look at how to define the options user can configure. This is a little further in the documentation:  
[https://gateway.dask.org/cluster-options.html#server-configuration](https://gateway.dask.org/cluster-options.html#server-configuration)

You could perfectly define a list of image to select from, or even a plain String field.

---

<div class="post-metadata">

### Author: ![dcieslak](https://avatars.discourse-cdn.com/v4/letter/d/f4b2a3/32.png) [@dcieslak](https://dask.discourse.group/u/dcieslak)
#### Post date: [October 11, 2023, 9:00pm UTC](https://dask.discourse.group/t/using-dask-gateway-to-create-clusters-with-different-images/2245/3 "2023-10-11T21:00:40Z")

</div>

Follow up question - I was able to use the technique above to set things like image and worker\_cores, basically values that I see in [Configuration Reference — Dask Gateway 2023.9.0 documentation](https://gateway.dask.org/api-server.html#cluster-config)

Now, lets say that I have 2 nodepools (to use an AKS term), one with GPU and another without. Nodes in each pool have different taints and labels.

How would a user be able to request a Dask cluster with nodes with GPUs (more generally tolerating a certain taint and setting a label) for one workload and a different Dask cluster (more generally tolerating a different taint (or no taint) and setting a different label)?

Much appreciated!

---

<div class="post-metadata">

### Author: ![guillaumeeb](https://yyz1.discourse-cdn.com/flex035/user_avatar/dask.discourse.group/guillaumeeb/32/1613_2.png) [@guillaumeeb](https://dask.discourse.group/u/guillaumeeb)
#### Post date: [October 12, 2023, 6:51pm UTC](https://dask.discourse.group/t/using-dask-gateway-to-create-clusters-with-different-images/2245/4 "2023-10-12T18:51:59Z")

</div>

According to the [KubeClusterConfig documentation](https://gateway.dask.org/api-server.html#kubeclusterconfig), you should be able to define things like `worker_extra_pod_annotations`, `worker_extra_pod_labels` and others using the Option mechanism.
