From 438a9839d2c1978cf5220f079f26751aa8ecb37e Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Sat, 7 Mar 2020 10:34:51 +0200 Subject: [PATCH 1/2] e2e: Update Istio to v1.5.0 --- test/e2e-istio.sh | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/test/e2e-istio.sh b/test/e2e-istio.sh index 1cb04e955..a7d9d9d00 100755 --- a/test/e2e-istio.sh +++ b/test/e2e-istio.sh @@ -2,23 +2,15 @@ set -o errexit -ISTIO_VER="1.4.5" +ISTIO_VER="1.5.0" REPO_ROOT=$(git rev-parse --show-toplevel) -echo ">>> Installing Istio ${ISTIO_VER}" -kubectl create ns istio-system -helm repo add istio.io https://storage.googleapis.com/istio-release/releases/${ISTIO_VER}/charts - -echo '>>> Installing Istio CRDs' -helm upgrade -i istio-init istio.io/istio-init --wait --namespace istio-system +echo ">>> Downloading Istio ${ISTIO_VER}" +cd ${REPO_ROOT}/bin && \ +curl -L https://istio.io/downloadIstio | ISTIO_VERSION=${ISTIO_VER} sh - -echo '>>> Waiting for Istio CRDs to be ready' -kubectl -n istio-system wait --for=condition=complete job/istio-init-crd-10-${ISTIO_VER} -kubectl -n istio-system wait --for=condition=complete job/istio-init-crd-11-${ISTIO_VER} -kubectl -n istio-system wait --for=condition=complete job/istio-init-crd-14-${ISTIO_VER} - -echo '>>> Installing Istio control plane' -helm upgrade -i istio istio.io/istio --wait --namespace istio-system -f ${REPO_ROOT}/test/e2e-istio-values.yaml +echo ">>> Installing Istio ${ISTIO_VER}" +${REPO_ROOT}/bin/istio-${ISTIO_VER}/bin/istioctl manifest apply --set profile=default kubectl -n istio-system get all From e76e718967eac7c76d710d9acbc4634901e7abbe Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Sat, 7 Mar 2020 11:52:37 +0200 Subject: [PATCH 2/2] e2e: Use custom latency check for Istio 1.5 --- .circleci/config.yml | 24 +------ cmd/flagger/main.go | 3 + test/{e2e-tests.sh => e2e-istio-tests.sh} | 88 ++++++++++++++--------- test/e2e-istio.sh | 2 + 4 files changed, 59 insertions(+), 58 deletions(-) rename test/{e2e-tests.sh => e2e-istio-tests.sh} (85%) diff --git a/.circleci/config.yml b/.circleci/config.yml index ecdc397e0..48310eb4a 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -81,7 +81,7 @@ jobs: - run: test/container-build.sh - run: test/e2e-kind.sh - run: test/e2e-istio.sh - - run: test/e2e-tests.sh + - run: test/e2e-istio-tests.sh e2e-kubernetes-daemonset-testing: machine: true @@ -105,28 +105,6 @@ jobs: - run: test/e2e-kubernetes.sh - run: test/e2e-kubernetes-tests-deployment.sh - e2e-kubernetes-svc-testing: - machine: true - steps: - - checkout - - attach_workspace: - at: /tmp/bin - - run: test/container-build.sh - - run: test/e2e-kind.sh - - run: test/e2e-kubernetes.sh - - run: test/e2e-kubernetes-svc-tests.sh - - e2e-smi-istio-testing: - machine: true - steps: - - checkout - - attach_workspace: - at: /tmp/bin - - run: test/container-build.sh - - run: test/e2e-kind.sh - - run: test/e2e-smi-istio.sh - - run: test/e2e-tests.sh canary - e2e-gloo-testing: machine: true steps: diff --git a/cmd/flagger/main.go b/cmd/flagger/main.go index f12fa83c9..d2eaafc39 100644 --- a/cmd/flagger/main.go +++ b/cmd/flagger/main.go @@ -125,6 +125,9 @@ func main() { } // use a remote cluster for routing if a service mesh kubeconfig is specified + if kubeconfigServiceMesh == "" { + kubeconfigServiceMesh = kubeconfig + } cfgHost, err := clientcmd.BuildConfigFromFlags(masterURL, kubeconfigServiceMesh) if err != nil { logger.Fatalf("Error building host kubeconfig: %v", err) diff --git a/test/e2e-tests.sh b/test/e2e-istio-tests.sh similarity index 85% rename from test/e2e-tests.sh rename to test/e2e-istio-tests.sh index a19ef5ed9..316006018 100755 --- a/test/e2e-tests.sh +++ b/test/e2e-istio-tests.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash # This script runs e2e tests for Canary, B/G and A/B initialization, analysis and promotion -# Prerequisites: Kubernetes Kind, Helm and Istio +# Prerequisites: Kubernetes Kind and Istio set -o errexit @@ -15,9 +15,36 @@ echo '>>> Installing the load tester' kubectl apply -k ${REPO_ROOT}/kustomize/tester kubectl -n test rollout status deployment/flagger-loadtester -echo '>>> Initialising canary' +echo '>>> Deploy podinfo' kubectl apply -f ${REPO_ROOT}/test/e2e-workload.yaml +echo '>>> Create latency metric template' +cat <>> Initialising canary' cat <>> Installing Istio ${ISTIO_VER}" ${REPO_ROOT}/bin/istio-${ISTIO_VER}/bin/istioctl manifest apply --set profile=default +kubectl -n istio-system rollout status deployment/prometheus + kubectl -n istio-system get all echo '>>> Load Flagger image in Kind'