Registry / devops / dask-kubernetes

dask-kubernetes

JSON →
library2026.3.0pypypiunverified

dask-kubernetes provides native integration for Dask with Kubernetes, allowing users to deploy and manage Dask clusters programmatically using the Python API (KubeCluster) or declaratively using Kubernetes Custom Resources (Dask Operator). The current version is 2026.3.0, and it follows a rapid release cadence, often monthly or quarterly, in alignment with the broader Dask ecosystem.

pip install dask-kubernetes
INSTALL
IMPORT
SIG · DASK-KUBERNETES
D
dask-kubernetes
devopspythonv2026.3.0
Install
16.1s avg
Import
Disk
232MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2026.3.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 223.2MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 16.1s · import 0.000s · 244MB
232MB installed
● package 232MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

KubeCluster
from dask_kubernetes import KubeCluster
from dask_kubernetes import KubeCluster

This quickstart demonstrates how to create a Dask cluster on Kubernetes using `KubeCluster`, connect a Dask client, perform a simple computation, and then scale the cluster. It assumes you have `kubectl` configured and authenticated to a Kubernetes cluster.

from dask_kubernetes import KubeCluster from dask.distributed import Client # Ensure you have a kubectl context configured for a running Kubernetes cluster. # KubeCluster automatically detects the current context. # Create a Dask cluster on Kubernetes cluster = KubeCluster(name="my-dask-cluster", n_workers=3) print(f"Dashboard link: {cluster.dashboard_link}") # Connect a Dask client to the cluster client = Client(cluster) # Perform a simple computation def inc(x): return x + 1 def add(x, y): return x + y futures = client.map(inc, range(10)) total = client.submit(add, *futures) print(f"Result of computation: {total.result()}") # Scale the cluster (optional) cluster.scale(5) print(f"Cluster scaled to {len(cluster.workers)} workers.") # Close the client and cluster when done client.close() cluster.close() print("Dask cluster and client closed.")
Debug
Known issues
breakingSupport for Python 3.9 was dropped in version 2024.8.0. Users on Python 3.9 must upgrade their Python environment.
fix
Upgrade your Python environment to 3.10 or newer.
affects: >=2024.8.0
gotchadask-kubernetes offers two main deployment strategies: `KubeCluster` (programmatic client-side) and the Dask Kubernetes Operator (CRD-based, declarative via YAML). Users often confuse these or apply inappropriate configurations.
fix
For interactive Python sessions or quick programmatic deployments, use `KubeCluster`. For persistent, enterprise-grade, or CI/CD deployments, consider installing the Dask Kubernetes Operator and defining `DaskCluster` CRDs via YAML. Consult the official documentation for detailed guidance on each approach.
affects: All versions
breakingThe minimum required version for `kopf` (a core dependency for the operator) was bumped to `1.38.0` in `dask-kubernetes==2025.7.0`.
fix
Ensure your `kopf` installation meets or exceeds version `1.38.0` if you are using the Dask Kubernetes Operator or related features.
affects: >=2025.7.0
breakingThe minimum required version for `kr8s` (a core dependency for Kubernetes interaction) was bumped to `0.20.*` in `dask-kubernetes==2025.4.0`.
fix
Ensure your `kr8s` installation meets or exceeds version `0.20.0` to avoid compatibility issues.
affects: >=2025.4.0
gotchaCommon errors arise from insufficient Kubernetes RBAC (Role-Based Access Control) permissions for the service account used by Dask pods. This can prevent pod creation, service exposure, or resource scaling.
fix
Ensure the Kubernetes ServiceAccount used by your Dask scheduler and worker pods has adequate permissions (e.g., `list`, `watch`, `create`, `delete` for `pods`, `services`, `deployments`, etc.) in the target namespace. Refer to the Dask Kubernetes documentation for recommended RBAC configurations or use the provided Helm chart which configures default roles.
affects: All versions
Upgrade
Version history
2026.3.0latest on PyPI · released Mar 2, 2026
Audit
Dependencies
pythonrequiredRequires Python 3.10 or newer.
kopfoptionalRequired for the Dask Kubernetes Operator functionality. Minimum version 1.38.0 as of 2025.7.0.
kr8srequiredCore dependency for Kubernetes interaction. Minimum version 0.20.* as of 2025.4.0.
Agent activity
31 hits · last 30 days
node
26
OpenAI (training)
1
Resources
dask-kubernetes — pip install dask-kubernetes · libregistry