From b104769f208fa97584a2f9d974056f5a31645854 Mon Sep 17 00:00:00 2001 From: Stefan Prodan Date: Fri, 20 Apr 2018 00:56:36 +0300 Subject: [PATCH] Istio use Hey to generate load --- deploy/istio-v1alpha3/README.md | 12 ++---- deploy/istio-v1alpha3/canary-dep.yaml | 2 +- deploy/istio-v1alpha3/ga-dep.yaml | 2 +- .../istio-v1alpha3/istio-virtual-service.yaml | 40 ++++++++++--------- 4 files changed, 28 insertions(+), 28 deletions(-) diff --git a/deploy/istio-v1alpha3/README.md b/deploy/istio-v1alpha3/README.md index aa4068d..294edaf 100644 --- a/deploy/istio-v1alpha3/README.md +++ b/deploy/istio-v1alpha3/README.md @@ -80,18 +80,14 @@ kubectl -n test apply -f ./deploy/istio-v1alpha3/istio-virtual-service.yaml kubectl -n test apply -f ./deploy/istio-v1alpha3/istio-gateway.yaml ``` -Create a `curl` pod for testing: +Create a `loadtest` pod for testing: ```bash -kubectl -n test run -i --rm --tty curl --image=radial/busyboxplus:curl --restart=Never -- sh +kubectl -n test run -i --rm --tty loadtest --image=stefanprodan/loadtest --restart=Never -- sh ``` -Run inside the `curl` pod: +Start the load test: ```bash -curl -v -H "Host: podinfo.test" http://podinfo.test:9898/version -version: 0.2.1 - -curl -v -H "x-user: insider" -H "Host: podinfo.test" http://podinfo.test:9898/version -version: 0.2.2 +hey -n 100000 -c 2 -q 5 http://podinfo.test:9898/version ``` diff --git a/deploy/istio-v1alpha3/canary-dep.yaml b/deploy/istio-v1alpha3/canary-dep.yaml index cf07ea7..ade470d 100644 --- a/deploy/istio-v1alpha3/canary-dep.yaml +++ b/deploy/istio-v1alpha3/canary-dep.yaml @@ -8,7 +8,7 @@ metadata: app: podinfo release: canary spec: - replicas: 2 + replicas: 1 selector: matchLabels: app: podinfo diff --git a/deploy/istio-v1alpha3/ga-dep.yaml b/deploy/istio-v1alpha3/ga-dep.yaml index 139f133..783fb19 100644 --- a/deploy/istio-v1alpha3/ga-dep.yaml +++ b/deploy/istio-v1alpha3/ga-dep.yaml @@ -8,7 +8,7 @@ metadata: app: podinfo release: ga spec: - replicas: 2 + replicas: 1 selector: matchLabels: app: podinfo diff --git a/deploy/istio-v1alpha3/istio-virtual-service.yaml b/deploy/istio-v1alpha3/istio-virtual-service.yaml index 5dee8b4..119075b 100644 --- a/deploy/istio-v1alpha3/istio-virtual-service.yaml +++ b/deploy/istio-v1alpha3/istio-virtual-service.yaml @@ -11,26 +11,30 @@ spec: gateways: - mesh - podinfo-gateway -# http: -# - route: -# - destination: -# name: podinfo -# subset: canary -# weight: 50 -# - destination: -# name: podinfo -# subset: ga -# weight: 50 http: - - match: - - headers: - x-user: - regex: ".*insider.*" - route: - - destination: - name: podinfo.test - subset: canary - route: + - destination: + name: podinfo.test + subset: canary + weight: 20 - destination: name: podinfo.test subset: ga + weight: 80 +# http: +# - match: +# - headers: +# x-user: +# exact: insider +# source_labels: +# release: ga +# route: +# - destination: +# name: podinfo.test +# subset: canary +# weight: 100 +# - route: +# - destination: +# name: podinfo.test +# subset: ga +# weight: 100