From 2e79817437cc53a71a6c1a59a00e49154f67d855 Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Sun, 6 Oct 2019 13:35:58 +0300 Subject: [PATCH] Add target port number e2e test for Linkerd --- test/README.md | 15 +++++++++++++++ test/e2e-linkerd-tests.sh | 12 ++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/test/README.md b/test/README.md index 977b7286..9126c6b5 100644 --- a/test/README.md +++ b/test/README.md @@ -20,6 +20,21 @@ The e2e testing infrastructure is powered by CircleCI and [Kubernetes Kind](http * test the canary analysis and promotion using weighted traffic and the load testing webhook [e2e-tests.sh](e2e-tests.sh) * test the A/B testing analysis and promotion using cookies filters and pre/post rollout webhooks [e2e-tests.sh](e2e-tests.sh) +### CircleCI e2e Linkerd workflow + +* install latest stable kubectl [e2e-kind.sh](e2e-kind.sh) +* install Kubernetes Kind [e2e-kind.sh](e2e-kind.sh) +* create local Kubernetes cluster with kind [e2e-kind.sh](e2e-kind.sh) +* install Linkerd [e2e-linkerd.sh](e2e-linkerd.sh) +* load Flagger image onto the local cluster [e2e-linkerd.sh](e2e-linkerd.sh) +* deploy Flagger in the linkerd namespace with Kustomize [e2e-linkerd.sh](e2e-linkerd.sh) +* create a test namespace with Linkerd injection enabled [e2e-linkerd-tests.sh](e2e-linkerd-tests.sh) +* deploy the load tester in the test namespace [e2e-linkerd-tests.sh](e2e-linkerd-tests.sh) +* deploy a demo workload (podinfo) in the test namespace [e2e-linkerd-tests.sh](e2e-linkerd-tests.sh) +* test the canary initialization with port discovery enabled and service target port [e2e-linkerd-tests.sh](e2e-linkerd-tests.sh) +* test the canary analysis and promotion using gPRC acceptance tests and HTTP load tests [e2e-linkerd-tests.sh](e2e-linkerd-tests.sh) +* test the canary rollback on HTTP 500 errors [e2e-linkerd-tests.sh](e2e-linkerd-tests.sh) + ### CircleCI e2e NGINX ingress workflow * install latest stable kubectl [e2e-kind.sh](e2e-kind.sh) diff --git a/test/e2e-linkerd-tests.sh b/test/e2e-linkerd-tests.sh index 47ca6511..dd7ef3ca 100755 --- a/test/e2e-linkerd-tests.sh +++ b/test/e2e-linkerd-tests.sh @@ -136,7 +136,8 @@ spec: name: podinfo progressDeadlineSeconds: 60 service: - port: 9898 + port: 80 + targetPort: 9898 canaryAnalysis: interval: 15s threshold: 3 @@ -150,12 +151,19 @@ spec: threshold: 500 interval: 30s webhooks: + - name: http-acceptance-test + type: pre-rollout + url: http://flagger-loadtester.test/ + timeout: 30s + metadata: + type: bash + cmd: "curl -sd 'test' http://podinfo-canary/token | grep token" - name: load-test url: http://flagger-loadtester.test/ timeout: 5s metadata: type: cmd - cmd: "hey -z 10m -q 10 -c 2 http://podinfo.test:9898/status/500" + cmd: "hey -z 10m -q 10 -c 2 http://podinfo.test/status/500" EOF echo '>>> Triggering canary deployment'