From 1ced3defc9aed90e8e33619f0540712a1412b7fb Mon Sep 17 00:00:00 2001 From: Ole Markus With Date: Sat, 5 Jun 2021 08:14:30 +0200 Subject: [PATCH 1/2] add e2e scenario script for testing cilium connectivity --- .../cilium-connectivity-test/run-test.sh | 46 +++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100755 tests/e2e/scenarios/cilium-connectivity-test/run-test.sh diff --git a/tests/e2e/scenarios/cilium-connectivity-test/run-test.sh b/tests/e2e/scenarios/cilium-connectivity-test/run-test.sh new file mode 100755 index 0000000000000..999f6aebdb0e2 --- /dev/null +++ b/tests/e2e/scenarios/cilium-connectivity-test/run-test.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash + +# Copyright 2020 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +REPO_ROOT=$(git rev-parse --show-toplevel); +source "${REPO_ROOT}"/tests/e2e/scenarios/lib/common.sh + +export KOPS_BASE_URL +KOPS_BASE_URL="$(curl -s https://storage.googleapis.com/kops-ci/bin/latest-ci-updown-green.txt)" +KOPS=$(kops-download-from-base) + +ARGS="--override=cluster.spec.networking.cilium.hubble.enabled=true --override=cluster.spec.certManager.enabled=true" + +if [[ $1 == "kube-proxy" ]]; then + ARGS="${ARGS} --override=cluster.spec.networking.cilium.enableNodePort=false --override=cluster.spec.kubeProxy.enabled=true" +# This test requires public topology, which kubetest2 does not support. +#elif [[ $1 == "eni"]] +# ARGS="${ARGS} --override=cluster.spec.cilium.ipam=eni --override=cluster.spec.cilium.disable-masquerade" +# ARGS="${ARGS} --topology private" +elif [[ $1 == "node-local-dns" ]]; then + ARGS="${ARGS} --override=cluster.spec.kubeDNS.provider=CoreDNS --override=cluster.spec.kubeDNS.nodeLocalDNS.enabled=true" +fi + +${KUBETEST2} \ + --up \ + --kubernetes-version="1.21.0" \ + --kops-binary-path="${KOPS}" \ + --create-args="--networking cilium $ARGS" + +kubectl port-forward -n kube-system deployment/hubble-relay 4245:4245 & + +wget -qO- https://github.com/cilium/cilium-cli/releases/download/v0.7/cilium-linux-amd64.tar.gz | tar xz -C "${WORKSPACE}" + +cilium connectivity test --all-flows \ No newline at end of file From f8cc8ba59bf229fbe2f982fe46e18894b47265c3 Mon Sep 17 00:00:00 2001 From: Ole Markus With Date: Sun, 6 Jun 2021 11:12:01 +0200 Subject: [PATCH 2/2] Update tests/e2e/scenarios/cilium-connectivity-test/run-test.sh Co-authored-by: Peter Rifel --- tests/e2e/scenarios/cilium-connectivity-test/run-test.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/e2e/scenarios/cilium-connectivity-test/run-test.sh b/tests/e2e/scenarios/cilium-connectivity-test/run-test.sh index 999f6aebdb0e2..9c6d8a4ecd5b5 100755 --- a/tests/e2e/scenarios/cilium-connectivity-test/run-test.sh +++ b/tests/e2e/scenarios/cilium-connectivity-test/run-test.sh @@ -25,7 +25,7 @@ ARGS="--override=cluster.spec.networking.cilium.hubble.enabled=true --override=c if [[ $1 == "kube-proxy" ]]; then ARGS="${ARGS} --override=cluster.spec.networking.cilium.enableNodePort=false --override=cluster.spec.kubeProxy.enabled=true" -# This test requires public topology, which kubetest2 does not support. +# This test requires private topology, which kubetest2 does not support. #elif [[ $1 == "eni"]] # ARGS="${ARGS} --override=cluster.spec.cilium.ipam=eni --override=cluster.spec.cilium.disable-masquerade" # ARGS="${ARGS} --topology private" @@ -43,4 +43,4 @@ kubectl port-forward -n kube-system deployment/hubble-relay 4245:4245 & wget -qO- https://github.com/cilium/cilium-cli/releases/download/v0.7/cilium-linux-amd64.tar.gz | tar xz -C "${WORKSPACE}" -cilium connectivity test --all-flows \ No newline at end of file +cilium connectivity test --all-flows