diff --git a/dask_kubernetes/common/networking.py b/dask_kubernetes/common/networking.py index 30dc3ff9f..5c81f7409 100644 --- a/dask_kubernetes/common/networking.py +++ b/dask_kubernetes/common/networking.py @@ -204,6 +204,7 @@ async def wait_for_scheduler(cluster_name, namespace, timeout=None): try: pod = await Pod.get( label_selector=f"dask.org/component=scheduler,dask.org/cluster-name={cluster_name}", + field_selector="status.phase=Running", namespace=namespace, ) except kr8s.NotFoundError: diff --git a/dask_kubernetes/operator/networking.py b/dask_kubernetes/operator/networking.py index 640646991..b7bd300b0 100644 --- a/dask_kubernetes/operator/networking.py +++ b/dask_kubernetes/operator/networking.py @@ -203,6 +203,7 @@ async def wait_for_scheduler(cluster_name, namespace, timeout=None): try: pod = await Pod.get( label_selector=f"dask.org/component=scheduler,dask.org/cluster-name={cluster_name}", + field_selector="status.phase=Running", namespace=namespace, ) except kr8s.NotFoundError: