Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

e2e: Istio 1.5 #479

Merged
merged 2 commits into from
Mar 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 1 addition & 23 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:
Expand Down
3 changes: 3 additions & 0 deletions cmd/flagger/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
88 changes: 53 additions & 35 deletions test/e2e-tests.sh → test/e2e-istio-tests.sh
Original file line number Diff line number Diff line change
@@ -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

Expand All @@ -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
Expand Down Expand Up @@ -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/
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
20 changes: 7 additions & 13 deletions test/e2e-istio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,17 @@

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 ${ISTIO_VER}"
${REPO_ROOT}/bin/istio-${ISTIO_VER}/bin/istioctl manifest apply --set profile=default

echo '>>> Installing Istio control plane'
helm upgrade -i istio istio.io/istio --wait --namespace istio-system -f ${REPO_ROOT}/test/e2e-istio-values.yaml
kubectl -n istio-system rollout status deployment/prometheus

kubectl -n istio-system get all

Expand Down