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

istio: Add source labels to analysis matching rules #594

Merged
merged 3 commits into from
May 27, 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
7 changes: 7 additions & 0 deletions artifacts/flagger/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 7 additions & 0 deletions charts/flagger/crds/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
31 changes: 30 additions & 1 deletion docs/gitbook/usage/deployment-strategies.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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:

Expand Down
7 changes: 7 additions & 0 deletions kustomize/base/flagger/crd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion test/e2e-istio.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
Expand Down