e2e: Use custom latency check for Istio 1.5

This commit is contained in:
stefanprodan
2020-03-07 11:57:46 +02:00
parent 438a9839d2
commit e76e718967
4 changed files with 59 additions and 58 deletions
+1 -23
View File
@@ -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:
+3
View File
@@ -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)
+53 -35
View File
@@ -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 <<EOF | kubectl apply -f -
apiVersion: flagger.app/v1beta1
kind: MetricTemplate
metadata:
name: latency
namespace: istio-system
spec:
provider:
type: prometheus
address: http://prometheus.istio-system:9090
query: |
histogram_quantile(
0.99,
sum(
rate(
istio_request_duration_milliseconds_bucket{
reporter="destination",
destination_workload_namespace="{{ namespace }}",
destination_workload=~"{{ target }}"
}[{{ interval }}]
)
) by (le)
)
EOF
echo '>>> Initialising canary'
cat <<EOF | kubectl apply -f -
apiVersion: flagger.app/v1beta1
kind: Canary
@@ -46,35 +73,16 @@ spec:
stepWeight: 10
metrics:
- name: request-success-rate
threshold: 99
thresholdRange:
min: 99
interval: 1m
- name: request-duration
threshold: 500
interval: 30s
- name: "404s percentage"
threshold: 5
- name: latency
templateRef:
name: latency
namespace: istio-system
thresholdRange:
max: 500
interval: 1m
query: |
100 - sum(
rate(
istio_requests_total{
reporter="destination",
destination_workload_namespace=~"test",
destination_workload=~"podinfo",
response_code!="404"
}[1m]
)
)
/
sum(
rate(
istio_requests_total{
reporter="destination",
destination_workload_namespace=~"test",
destination_workload=~"podinfo"
}[1m]
)
) * 100
webhooks:
- name: load-test
url: http://flagger-loadtester.test/
@@ -167,10 +175,15 @@ spec:
iterations: 5
metrics:
- name: request-success-rate
threshold: 99
thresholdRange:
min: 99
interval: 1m
- name: request-duration
threshold: 500
- name: latency
templateRef:
name: latency
namespace: istio-system
thresholdRange:
max: 500
interval: 30s
webhooks:
- name: http-acceptance-test
@@ -260,10 +273,15 @@ spec:
regex: "^(.*?;)?(type=insider)(;.*)?$"
metrics:
- name: request-success-rate
threshold: 99
thresholdRange:
min: 99
interval: 1m
- name: request-duration
threshold: 500
- name: latency
templateRef:
name: latency
namespace: istio-system
thresholdRange:
max: 500
interval: 30s
webhooks:
- name: pre
+2
View File
@@ -12,6 +12,8 @@ curl -L https://istio.io/downloadIstio | ISTIO_VERSION=${ISTIO_VER} sh -
echo ">>> 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'