Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically rescale to recover from pod deletion #717

Closed
wants to merge 12 commits into from
1 change: 1 addition & 0 deletions dask_kubernetes/operator/controller/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ async def get_desired_workers(scheduler_service_name, namespace, logger):


@kopf.on.field("daskworkergroup.kubernetes.dask.org", field="spec.worker.replicas")
@kopf.on.delete("pod", labels={"dask.org/component": "worker"})
async def daskworkergroup_replica_update(
name, namespace, meta, spec, new, body, logger, **kwargs
):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,14 @@ async def test_scalesimplecluster(k8s_cluster, kopf_runner, gen_cluster):
"simple-default",
)
await client.wait_for_workers(3)
k8s_cluster.kubectl(
"delete",
"pod",
"-l",
"dask.org/component=worker",
)
await client.wait_for_workers(0) # initial deletion
await client.wait_for_workers(3) # recovery


@pytest.mark.timeout(180)
Expand Down