{"id":7133,"library":"dask-kubernetes","title":"Dask Kubernetes","description":"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.","status":"active","version":"2026.3.0","language":"python","source_language":"en","source_url":"https://github.com/dask/dask-kubernetes","tags":["dask","kubernetes","distributed-computing","orchestration","mlops"],"install":[{"cmd":"pip install dask-kubernetes","lang":"bash","label":"Install stable version"}],"dependencies":[{"reason":"Requires Python 3.10 or newer.","package":"python","optional":false},{"reason":"Required for the Dask Kubernetes Operator functionality. Minimum version 1.38.0 as of 2025.7.0.","package":"kopf","optional":true},{"reason":"Core dependency for Kubernetes interaction. Minimum version 0.20.* as of 2025.4.0.","package":"kr8s","optional":false}],"imports":[{"wrong":"from dask_kubernetes import KubeCluster","symbol":"KubeCluster","correct":"from dask_kubernetes import KubeCluster"}],"quickstart":{"code":"from dask_kubernetes import KubeCluster\nfrom dask.distributed import Client\n\n# Ensure you have a kubectl context configured for a running Kubernetes cluster.\n# KubeCluster automatically detects the current context.\n\n# Create a Dask cluster on Kubernetes\ncluster = KubeCluster(name=\"my-dask-cluster\", n_workers=3)\nprint(f\"Dashboard link: {cluster.dashboard_link}\")\n\n# Connect a Dask client to the cluster\nclient = Client(cluster)\n\n# Perform a simple computation\ndef inc(x): return x + 1\ndef add(x, y): return x + y\n\nfutures = client.map(inc, range(10))\ntotal = client.submit(add, *futures)\nprint(f\"Result of computation: {total.result()}\")\n\n# Scale the cluster (optional)\ncluster.scale(5)\nprint(f\"Cluster scaled to {len(cluster.workers)} workers.\")\n\n# Close the client and cluster when done\nclient.close()\ncluster.close()\nprint(\"Dask cluster and client closed.\")","lang":"python","description":"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."},"warnings":[{"fix":"Upgrade your Python environment to 3.10 or newer.","message":"Support for Python 3.9 was dropped in version 2024.8.0. Users on Python 3.9 must upgrade their Python environment.","severity":"breaking","affected_versions":">=2024.8.0"},{"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.","message":"dask-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.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Ensure your `kopf` installation meets or exceeds version `1.38.0` if you are using the Dask Kubernetes Operator or related features.","message":"The minimum required version for `kopf` (a core dependency for the operator) was bumped to `1.38.0` in `dask-kubernetes==2025.7.0`.","severity":"breaking","affected_versions":">=2025.7.0"},{"fix":"Ensure your `kr8s` installation meets or exceeds version `0.20.0` to avoid compatibility issues.","message":"The minimum required version for `kr8s` (a core dependency for Kubernetes interaction) was bumped to `0.20.*` in `dask-kubernetes==2025.4.0`.","severity":"breaking","affected_versions":">=2025.4.0"},{"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.","message":"Common 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.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'2026.3.0':39 'align':52 'allow':13 'api':25 'broader':55 'cadenc':46 'cluster':20 'comput':62 'current':36 'custom':31 'dask':1,4,10,19,33,56,58 'dask-kubernet':3 'declar':28 'deploy':16 'distribut':61 'distributed-comput':60 'ecosystem':57 'follow':42 'integr':8 'kubeclust':26 'kubernet':2,5,12,30,59 'manag':18 'mlop':64 'month':48 'nativ':7 'often':47 'oper':34 'orchestr':63 'programmat':21 'provid':6 'python':24 'quarter':50 'rapid':44 'releas':45 'resourc':32 'use':22,29 'user':14 'version':37","created_at":"2026-04-16T13:44:53.915636+00:00","updated_at":"2026-04-16T13:44:53.915636+00:00","problems":{"verify_error":"Traceback (most recent call last):\n  File \"<string>\", line 1, in <module>\nImportError: cannot import name 'KubeCluster' from 'dask_kubernetes' (/tmp/tmps18fv8sw/venv/lib/python3.12/site-packages/dask_kubernetes/__init__.py)"},"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"2026.3.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/dask/dask-kubernetes","docs":null,"changelog":null,"pypi":"https://pypi.org/project/dask-kubernetes/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","data","workflow"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"import_fail","verified_at":"2026-07-03","last_verified":"2026-07-03","next_check":"2026-07-10","install_tag":null}}