Hi, does anyone know how to set the service account for the dask workers in an ephemeral cluster? Th...
b
Hi, does anyone know how to set the service account for the dask workers in an ephemeral cluster? This may be more of a dask question but the k8s pods are being set to
default
and was wondering if anyone ran into the same issue. Example executor code is in the thread.
Copy code
DaskExecutor(
        cluster_class=lambda: KubeCluster(
            name=slugify(prefect.context.flow_name),
            pod_template=make_pod_spec(
                image=prefect.context.image,
                cpu_request="1000m",
                memory_request="2Gi",
                threads_per_worker=2,
                env=env_dict,
                extra_pod_config={
                    "serviceAccount": "dask-workflows-sa",
                    "serviceAccountName": "dask-workflows-sa",
                    "priority": 1,
                }
            ),
            scheduler_pod_template=make_pod_spec(
                image=prefect.context.image,
                cpu_request="1000m",
                memory_request="1Gi",
            ),
        ),
        adapt_kwargs={
            "minimum": 1,
            "maximum": 4,
        },
    )
I tried to also set
priority
but it doesn’t seem like anything in the
extra_pod_config
block makes it to the worker pod.
k
Hey @Brad I, did you try through the RunConfig?
KubernetesRun(service_account_name="")
? I went through KubeCluster docs and this looks right. I don’t know why the
extra_pod_config
wouldn’t be respected
b
Hi @Kevin Kho, thanks for the suggestion, but unfortunately the scheduler and worker k8s yaml still shows
default
as the serviceAccount and serviceAccountName. We also have the service account set as the default in our agent. The dask documents mention a
config.yaml
or
~/.kube/config
file, is that something I can pass through the
DaskExecutor
or should I try setting it inside our docker image?
@Kevin Kho, weird, so I commented out the separate
scheduler_pod_template
and everything seems to work. So I needed to make your change plus let dask use the same pod template for both workers and the scheduler. As long as it’s working 🤷 , thanks!
k
What!? I am confused by that (and how you figured it out) by glad you got it working!