diff --git a/CHANGELOG.md b/CHANGELOG.md index b76cd01a..319caa32 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,25 @@ All notable changes to this project are documented in this file. +## 1.6.0 + +**Release date:** 2021-01-05 + +**Breaking change:** the minimum supported version of Kubernetes is v1.16.0. + +This release comes with support for A/B testing using [Gloo Edge](https://docs.flagger.app/tutorials/gloo-progressive-delivery) +HTTP headers based routing. + +#### Features + +- A/B testing support for Gloo Edge ingress controller + [#765](https://github.com/fluxcd/flagger/pull/765) + +#### Improvements + +- Upgrade the Kubernetes packages to `v1.20.1` and Flagger's CRDs to `apiextensions.k8s.io/v1` + [#772](https://github.com/fluxcd/flagger/pull/772) + ## 1.5.0 **Release date:** 2020-12-22 diff --git a/artifacts/flagger/deployment.yaml b/artifacts/flagger/deployment.yaml index 4aaef776..fe148f0f 100644 --- a/artifacts/flagger/deployment.yaml +++ b/artifacts/flagger/deployment.yaml @@ -22,7 +22,7 @@ spec: serviceAccountName: flagger containers: - name: flagger - image: ghcr.io/fluxcd/flagger:1.5.0 + image: ghcr.io/fluxcd/flagger:1.6.0 imagePullPolicy: IfNotPresent ports: - name: http diff --git a/charts/flagger/Chart.yaml b/charts/flagger/Chart.yaml index 4996ce05..c1e4339b 100644 --- a/charts/flagger/Chart.yaml +++ b/charts/flagger/Chart.yaml @@ -1,7 +1,7 @@ apiVersion: v1 name: flagger -version: 1.5.0 -appVersion: 1.5.0 +version: 1.6.0 +appVersion: 1.6.0 kubeVersion: ">=1.16.0-0" engine: gotpl description: Flagger is a progressive delivery operator for Kubernetes diff --git a/charts/flagger/values.yaml b/charts/flagger/values.yaml index f05c78a1..a094da22 100644 --- a/charts/flagger/values.yaml +++ b/charts/flagger/values.yaml @@ -2,7 +2,7 @@ image: repository: ghcr.io/fluxcd/flagger - tag: 1.5.0 + tag: 1.6.0 pullPolicy: IfNotPresent pullSecret: diff --git a/docs/gitbook/tutorials/gloo-progressive-delivery.md b/docs/gitbook/tutorials/gloo-progressive-delivery.md index 0f233415..72b21e07 100644 --- a/docs/gitbook/tutorials/gloo-progressive-delivery.md +++ b/docs/gitbook/tutorials/gloo-progressive-delivery.md @@ -383,5 +383,90 @@ Canary failed! Scaling down podinfo.test If you have [alerting](../usage/alerting.md) configured, Flagger will send a notification with the reason why the canary failed. -For an in-depth look at the analysis process read the [usage docs](../usage/how-it-works.md). +## A/B Testing +Besides weighted routing, Flagger can be configured to route traffic to the canary based on HTTP match conditions. +In an A/B testing scenario, you'll be using HTTP headers or cookies to target a certain segment of your users. +This is particularly useful for frontend applications that require session affinity. + +![Flagger A/B Testing Stages](https://raw.githubusercontent.com/fluxcd/flagger/main/docs/diagrams/flagger-abtest-steps.png) + +Edit the canary analysis, remove the max/step weight and add the match conditions and iterations: + +```yaml +analysis: + interval: 1m + threshold: 5 + iterations: 10 + match: + - headers: + x-canary: + exact: "insider" + webhooks: + - name: load-test + url: http://flagger-loadtester.test/ + metadata: + cmd: "hey -z 1m -q 5 -c 5 -H 'X-Canary: insider' -host app.example.com http://gateway-proxy.gloo-system" +``` + +The above configuration will run an analysis for ten minutes targeting users that have a `X-Canary: insider` header. + +Trigger a canary deployment by updating the container image: + +```bash +kubectl -n test set image deployment/podinfo \ +podinfod=stefanprodan/podinfo:3.1.4 +``` + +Flagger detects that the deployment revision changed and starts the A/B test: + +```text +kubectl -n gloo-system logs deploy/flagger -f | jq .msg + +New revision detected! Progressing canary analysis for podinfo.test +Advance podinfo.test canary iteration 1/10 +Advance podinfo.test canary iteration 2/10 +Advance podinfo.test canary iteration 3/10 +Advance podinfo.test canary iteration 4/10 +Advance podinfo.test canary iteration 5/10 +Advance podinfo.test canary iteration 6/10 +Advance podinfo.test canary iteration 7/10 +Advance podinfo.test canary iteration 8/10 +Advance podinfo.test canary iteration 9/10 +Advance podinfo.test canary iteration 10/10 +Copying podinfo.test template spec to podinfo-primary.test +Waiting for podinfo-primary.test rollout to finish: 1 of 2 updated replicas are available +Routing all traffic to primary +Promotion completed! Scaling down podinfo.test +``` + +The web browser user agent header allows user segmentation based on device or OS. + +For example, if you want to route all mobile users to the canary instance: + +```yaml +match: +- headers: + user-agent: + regex: ".*Mobile.*" +``` + +Or if you want to target only Android users: + +```yaml +match: +- headers: + user-agent: + regex: ".*Android.*" +``` + +Or a specific browser version: + +```yaml +match: +- headers: + user-agent: + regex: ".*Firefox.*" +``` + +For an in-depth look at the analysis process read the [usage docs](../usage/how-it-works.md). diff --git a/kustomize/base/flagger/kustomization.yaml b/kustomize/base/flagger/kustomization.yaml index e5c32271..b2f895bb 100644 --- a/kustomize/base/flagger/kustomization.yaml +++ b/kustomize/base/flagger/kustomization.yaml @@ -7,5 +7,6 @@ resources: - crd.yaml - deployment.yaml images: - - name: fluxcd/flagger - newTag: 1.5.0 + - name: ghcr.io/fluxcd/flagger + newName: ghcr.io/fluxcd/flagger + newTag: 1.6.0 diff --git a/pkg/version/version.go b/pkg/version/version.go index c60cce9a..e24cbc6e 100644 --- a/pkg/version/version.go +++ b/pkg/version/version.go @@ -16,5 +16,5 @@ limitations under the License. package version -var VERSION = "1.5.0" +var VERSION = "1.6.0" var REVISION = "unknown"