dask-gateway icon indicating copy to clipboard operation
dask-gateway copied to clipboard

Helm chart: add imagePullSecrets for gateway.backend

Open chadsr opened this issue 3 years ago • 1 comments

This PR adds imagePullSecrets support for the gateway.backend (dask-gateway) image used by schedulers and workers.

chadsr avatar Jun 29 '22 09:06 chadsr

Support for the idea of this PR

Since we provide a dedicated option for the image pull policy and image name/tag etc for gateway.backend, I support adding imagePullSecrets next to it as well. But, we should not add everything we can configure as a dedicated configuration, then we should use the workaround below instead.

A workaround

imagePullSecrets can be configured via the following config options:

https://github.com/dask/dask-gateway/blob/e6ee014730991730ede59cbeb6ebaded27b0d22f/dask-gateway-server/dask_gateway_server/backends/kubernetes/backend.py#L143-L180

that are exposed via the Helm chart's gateway.backend.scheduler.extraContainerConfig and gateway.backend.worker.extraContainerConfig that you can pass imagePullSecrets to.

Since gateway.backend.imagePullSecrets

consideRatio avatar Jun 29 '22 10:06 consideRatio

Hi,

Thanks @consideRatio for your input. I believe there should be gateway.backend.scheduler.extraPodConfig instead of gateway.backend.scheduler.extraContainerConfig

The minimal working proof:

jupyterhub:
  proxy:
    secretToken: "<token-1>"
  hub:
    services:
      dask-gateway:
        apiToken: "<token-2>"
dask-gateway:
  gateway:
    auth:
      jupyterhub:
        apiToken: "<token-2>"
    extraConfig:
      optionHandler: |
        from dask_gateway_server.options import Options, String
        def option_handler(options):
            return {
                "image": options.image,
                "scheduler_extra_pod_config": {"imagePullSecrets": [{"name": options.extra_pod_config}]},
            }
        c.Backend.cluster_options = Options(
            String("image", label="Image"),
            String("extra_pod_config", label="Image Pull Secrets"),
            handler=option_handler,
        )

If the scheduler and workers use the same image within the cluster, I am unsure whether to add "worker_extra_pod_config": {"imagePullSecrets": [{"name": options.extra_pod_config}]} to the returned function.

Best regards, Wiktor

szachovy avatar Sep 08 '22 13:09 szachovy