Skip to content

ClusterDomain can be different to default value .cluster.local #957

Open

Description

@dbalabka

Describe the issue:
The library makes a strong assumption that ClusterDomain is the same for any cluster:

scheduler_env = {
"name": "DASK_SCHEDULER_ADDRESS",
"value": f"tcp://{cluster_name}-scheduler.{namespace}.svc.cluster.local:8786",

and passes DASK_SCHEDULER_ADDRESS that always ends with .cluster.local. However, this part can be configured in CoreDNS to a different domain. It is useful when multiple Kubernetes clusters are set up and require unique DNS records and the ability to communicate with each other.

However, the pod tries to reach out to any other pod in the same cluster and the same domain, we don't have to specify the FQN of the cluster domain:
https://kubernetes.io/docs/concepts/services-networking/dns-pod-service/#:~:text=In%20summary%2C%20a%20Pod%20in%20the%20test%20namespace%20can%20successfully%20resolve%20either%20data.prod%20or%20data.prod.svc.cluster.local

Minimal Complete Verifiable Example:

Change the ClusterDomain in CoreDNS configuration to something different:
https://kubernetes.io/docs/tasks/administer-cluster/dns-custom-nameservers/

Environment:

  • Dask version: 2024.12.1
  • Python version: 3.11
  • Operating System: WSL
  • Install method (conda, pip, source): poetry

Activity

  1. dbalabka commented on Jul 18, 2025

    @dbalabka
    ContributorAuthor

    The workaround is to set the scheduler address explicitly and omit the .cluster.local:

    env_variables["DASK_SCHEDULER_ADDRESS"] = f"tcp://{cluster_name}-scheduler.{namespace}:8786"

    Note that DASK_SCHEDULER_ADDRESS override works only starting with latest version of the 2024 releases of dask-kubernetes-operator

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions