From 476eb8c185b37058aeab93d973fb084862b33d03 Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Mon, 18 May 2020 13:15:12 +0300 Subject: [PATCH 1/3] Update Istio e2e to v1.5.4 --- test/e2e-istio.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/e2e-istio.sh b/test/e2e-istio.sh index 5d84d6c3..ef65da48 100755 --- a/test/e2e-istio.sh +++ b/test/e2e-istio.sh @@ -2,7 +2,7 @@ set -o errexit -ISTIO_VER="1.5.2" +ISTIO_VER="1.5.4" REPO_ROOT=$(git rev-parse --show-toplevel) echo ">>> Downloading Istio ${ISTIO_VER}" From 3cf6400092b6b49b3126a67c7f505c5dc0d28c4d Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Mon, 18 May 2020 13:16:03 +0300 Subject: [PATCH 2/3] Add source labels to analysis matching rules --- artifacts/flagger/crd.yaml | 7 +++++++ charts/flagger/crds/crd.yaml | 7 +++++++ kustomize/base/flagger/crd.yaml | 7 +++++++ 3 files changed, 21 insertions(+) diff --git a/artifacts/flagger/crd.yaml b/artifacts/flagger/crd.yaml index d17a3589..a56b9e1a 100644 --- a/artifacts/flagger/crd.yaml +++ b/artifacts/flagger/crd.yaml @@ -599,8 +599,15 @@ spec: format: string type: string regex: + description: RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax) format: string type: string + sourceLabels: + description: Applicable only when the 'mesh' gateway is included in the service.gateways list + type: object + additionalProperties: + format: string + type: string metrics: description: Metric check list for this canary type: array diff --git a/charts/flagger/crds/crd.yaml b/charts/flagger/crds/crd.yaml index d17a3589..a56b9e1a 100644 --- a/charts/flagger/crds/crd.yaml +++ b/charts/flagger/crds/crd.yaml @@ -599,8 +599,15 @@ spec: format: string type: string regex: + description: RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax) format: string type: string + sourceLabels: + description: Applicable only when the 'mesh' gateway is included in the service.gateways list + type: object + additionalProperties: + format: string + type: string metrics: description: Metric check list for this canary type: array diff --git a/kustomize/base/flagger/crd.yaml b/kustomize/base/flagger/crd.yaml index d17a3589..a56b9e1a 100644 --- a/kustomize/base/flagger/crd.yaml +++ b/kustomize/base/flagger/crd.yaml @@ -599,8 +599,15 @@ spec: format: string type: string regex: + description: RE2 style regex-based match (https://github.com/google/re2/wiki/Syntax) format: string type: string + sourceLabels: + description: Applicable only when the 'mesh' gateway is included in the service.gateways list + type: object + additionalProperties: + format: string + type: string metrics: description: Metric check list for this canary type: array From 4f299e56967053d7b7c253e5c980ce5a1171148e Mon Sep 17 00:00:00 2001 From: stefanprodan Date: Mon, 18 May 2020 14:41:44 +0300 Subject: [PATCH 3/3] Add source labels to A/B testing docs --- docs/gitbook/usage/deployment-strategies.md | 31 ++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/docs/gitbook/usage/deployment-strategies.md b/docs/gitbook/usage/deployment-strategies.md index e6781e52..4033d3cd 100644 --- a/docs/gitbook/usage/deployment-strategies.md +++ b/docs/gitbook/usage/deployment-strategies.md @@ -159,6 +159,34 @@ And the time it takes for a canary to be rollback when the metrics or webhook ch interval * threshold ``` +Istio example: + +```yaml + analysis: + interval: 1m + threshold: 10 + iterations: 2 + match: + - headers: + x-canary: + exact: "insider" + - headers: + cookie: + regex: "^(.*?;)?(canary=always)(;.*)?$" + - sourceLabels: + app.kubernetes.io/name: "scheduler" +``` + +The header keys must be lowercase and use hyphen as the separator. +Header values are case-sensitive and formatted as follows: +- `exact: "value"` for exact string match +- `prefix: "value"` for prefix-based match +- `suffix: "value"` for suffix-based match +- `regex: "value"` for [RE2](https://github.com/google/re2/wiki/Syntax) style regex-based match + +Note that the `sourceLabels` match conditions are applicable only when the `mesh` gateway +is included in the `canary.service.gateways` list. + App Mesh example: ```yaml @@ -205,7 +233,8 @@ NGINX example: exact: "canary" ``` -Note that the NGINX ingress controller supports only exact matching for a single header and the cookie value is set to `always`. +Note that the NGINX ingress controller supports only exact matching for cookies names where the value must be set to `always`. +Starting with NGINX ingress v0.31, regex matching is supported for header values. The above configurations will route users with the x-canary header or canary cookie to the canary instance during analysis: