From 77aa02894546fa1ef9cca344a65ab9eaef416418 Mon Sep 17 00:00:00 2001 From: Jacob Tomlinson Date: Wed, 18 May 2022 13:14:25 +0100 Subject: [PATCH] Disable istio sidecar injection --- .github/workflows/operator.yaml | 2 ++ ci/install-deps.sh | 3 +++ dask_kubernetes/conftest.py | 10 ++++++++++ dask_kubernetes/operator/operator.py | 2 ++ 4 files changed, 17 insertions(+) diff --git a/.github/workflows/operator.yaml b/.github/workflows/operator.yaml index 0c1158030..ad91ab99e 100644 --- a/.github/workflows/operator.yaml +++ b/.github/workflows/operator.yaml @@ -18,6 +18,7 @@ on: jobs: test: runs-on: ubuntu-latest + timeout-minutes: 30 strategy: fail-fast: false matrix: @@ -33,4 +34,5 @@ jobs: - name: Run tests env: KUBECONFIG: .pytest-kind/pytest-kind/kubeconfig + TEST_ISTIO: "true" run: pytest dask_kubernetes/common/tests dask_kubernetes/operator/tests dask_kubernetes/experimental/tests diff --git a/ci/install-deps.sh b/ci/install-deps.sh index 8a3e79e26..3d632a650 100755 --- a/ci/install-deps.sh +++ b/ci/install-deps.sh @@ -1,5 +1,8 @@ #!/bin/bash +curl -L https://istio.io/downloadIstio | sh - +mv istio-*/bin/istioctl /usr/local/bin/istioctl + pip install -e . pip install -r requirements-test.txt pip install git+https://github.com/dask/distributed@main diff --git a/dask_kubernetes/conftest.py b/dask_kubernetes/conftest.py index f70bd2ee4..7abedb17c 100644 --- a/dask_kubernetes/conftest.py +++ b/dask_kubernetes/conftest.py @@ -36,6 +36,16 @@ def k8s_cluster(kind_cluster, docker_image): del os.environ["KUBECONFIG"] +@pytest.fixture(scope="session", autouse=True) +def install_istio(k8s_cluster): + if bool(os.environ.get("TEST_ISTIO", False)): + check_dependency("istioctl") + subprocess.check_output(["istioctl", "install", "--set", "profile=demo", "-y"]) + k8s_cluster.kubectl( + "label", "namespace", "default", "istio-injection=enabled", "--overwrite" + ) + + @pytest.fixture(scope="session") def ns(k8s_cluster): return "default" diff --git a/dask_kubernetes/operator/operator.py b/dask_kubernetes/operator/operator.py index e1e7e6b8b..a143f7b63 100644 --- a/dask_kubernetes/operator/operator.py +++ b/dask_kubernetes/operator/operator.py @@ -22,6 +22,7 @@ def build_scheduler_pod_spec(name, spec): "labels": { "dask.org/cluster-name": name, "dask.org/component": "scheduler", + "sidecar.istio.io/inject": "false", }, }, "spec": spec, @@ -53,6 +54,7 @@ def build_worker_pod_spec(name, cluster_name, n, spec): "dask.org/cluster-name": cluster_name, "dask.org/workergroup-name": name, "dask.org/component": "worker", + "sidecar.istio.io/inject": "false", }, }, "spec": spec,