From 4bd5154655d517994b7071d385a3e0c25a484fcb Mon Sep 17 00:00:00 2001 From: Carlos Sanchez Date: Fri, 1 Feb 2019 13:45:08 +0100 Subject: [PATCH] Add flagger demo instructions --- .../templates/canary.yaml | 6 ++-- flagger/README.md | 29 +++++++++++++++++++ flagger/croc-hunter-canary.yaml | 6 ++-- 3 files changed, 35 insertions(+), 6 deletions(-) diff --git a/charts/croc-hunter-jenkinsx/templates/canary.yaml b/charts/croc-hunter-jenkinsx/templates/canary.yaml index 2f1b637..a76b319 100644 --- a/charts/croc-hunter-jenkinsx/templates/canary.yaml +++ b/charts/croc-hunter-jenkinsx/templates/canary.yaml @@ -30,7 +30,7 @@ spec: - croc-hunter.istio.eu.g.csanchez.org canaryAnalysis: # schedule interval (default 60s) - interval: 15s + interval: 30s # max number of failed metric checks before rollback threshold: 5 # max traffic percentage routed to canary @@ -44,10 +44,10 @@ spec: # minimum req success rate (non 5xx responses) # percentage (0-100) threshold: 99 - interval: 30s + interval: 60s - name: istio_request_duration_seconds_bucket # maximum req duration P99 # milliseconds threshold: 500 - interval: 30s + interval: 60s {{- end }} diff --git a/flagger/README.md b/flagger/README.md index 00d534e..375e041 100644 --- a/flagger/README.md +++ b/flagger/README.md @@ -26,3 +26,32 @@ Go to the `canary-analysis` dashboard and select * namespace: `jx-production` * primary: `jx-production-croc-hunter-jenkinsx-primary` * canary: `jx-production-croc-hunter-jenkinsx` + +to see the roll out metrics. + +# Prometheus Metrics + + kubectl --namespace istio-system port-forward deploy/prometheus 9090 + +# Demo + +Promote to production + + jx promote croc-hunter-jenkinsx --env production --version 0.0.xxx + +Tail the flagger logs + + kail -d flagger --since=5m + +Generate traffic to show the version served + + while true; do + out=$(curl -sSL -w "%{http_code}" http://croc-hunter.istio.us.g.csanchez.org/) + date="$(date +%R:%S)"; echo -n $date + echo -n "$out" | tail -n 1 ; echo -n "-" ; echo "$out" | grep Release | grep -o '\d*\.\d*\.\d*' + done + +Generate delays and errors to show automatic rollbacks + + watch curl -sSL http://croc-hunter.istio.us.g.csanchez.org/delay?wait=5 + watch curl -sSL http://croc-hunter.istio.us.g.csanchez.org/status?code=500 diff --git a/flagger/croc-hunter-canary.yaml b/flagger/croc-hunter-canary.yaml index b63f44a..7eb4da1 100644 --- a/flagger/croc-hunter-canary.yaml +++ b/flagger/croc-hunter-canary.yaml @@ -30,7 +30,7 @@ spec: - croc-hunter.istio.eu.g.csanchez.org canaryAnalysis: # schedule interval (default 60s) - interval: 15s + interval: 30s # max number of failed metric checks before rollback threshold: 5 # max traffic percentage routed to canary @@ -44,9 +44,9 @@ spec: # minimum req success rate (non 5xx responses) # percentage (0-100) threshold: 99 - interval: 30s + interval: 60s - name: istio_request_duration_seconds_bucket # maximum req duration P99 # milliseconds threshold: 500 - interval: 30s \ No newline at end of file + interval: 60s \ No newline at end of file