-
Notifications
You must be signed in to change notification settings - Fork 906
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Adds support for Istio traffic mirroring (#2074)
* feat: Add support for istio traffic mirroring steps Signed-off-by: zachaller <[email protected]> * bump e2e timeout Signed-off-by: zachaller <[email protected]> * Remove unintended change Signed-off-by: zachaller <[email protected]> * Cleaner events Signed-off-by: zachaller <[email protected]> * Add docs for mirror and fix up header routing Signed-off-by: zachaller <[email protected]> * small doc changes Signed-off-by: zachaller <[email protected]> * Add example Signed-off-by: zachaller <[email protected]> * Fix types and change example Signed-off-by: zachaller <[email protected]> * Remove unused type Signed-off-by: zachaller <[email protected]> * Docs change Signed-off-by: zachaller <[email protected]> * Fix PR comments Signed-off-by: zachaller <[email protected]> * Check for >= Signed-off-by: zachaller <[email protected]> * Remove unused function Signed-off-by: zachaller <[email protected]> * codegen Signed-off-by: zachaller <[email protected]> * Add better error logging Signed-off-by: zachaller <[email protected]> * a few more error msgs Signed-off-by: zachaller <[email protected]> * fix comments Signed-off-by: zachaller <[email protected]> * typo Signed-off-by: zachaller <[email protected]> * fix logic error Signed-off-by: zachaller <[email protected]> * redo header logic Signed-off-by: zachaller <[email protected]> * cleanup Signed-off-by: zachaller <[email protected]> * Fix issue with keeping route weight updated when no routes are defined in spec.strategy.canary.trafficRouting.istio.virtualService.routes requiring only a single route Signed-off-by: zachaller <[email protected]> * cleanup routes when promiting with last step being a pause Signed-off-by: zachaller <[email protected]> * fix bug with promote and last step is a pause Signed-off-by: zachaller <[email protected]> * Fix tests Signed-off-by: zachaller <[email protected]> * fix typo Signed-off-by: zachaller <[email protected]>
- Loading branch information
Showing
47 changed files
with
4,600 additions
and
941 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
## This examples sets up istio mirroring if running locally using docker for destkop you can add | ||
## istio-host-split.com to your /etc/hosts and point it to 127.0.0.1 to view demo. | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: istio-host-split-canary | ||
spec: | ||
ports: | ||
- port: 80 | ||
targetPort: http | ||
protocol: TCP | ||
name: http | ||
selector: | ||
app: istio-host-split | ||
|
||
--- | ||
apiVersion: v1 | ||
kind: Service | ||
metadata: | ||
name: istio-host-split-stable | ||
spec: | ||
ports: | ||
- port: 80 | ||
targetPort: http | ||
protocol: TCP | ||
name: http | ||
selector: | ||
app: istio-host-split | ||
|
||
--- | ||
apiVersion: networking.istio.io/v1alpha3 | ||
kind: VirtualService | ||
metadata: | ||
name: istio-host-split-vsvc | ||
spec: | ||
hosts: | ||
- istio-host-split.com | ||
gateways: | ||
- istio-host-split-gateway | ||
http: | ||
- name: primary | ||
route: | ||
- destination: | ||
host: istio-host-split-stable | ||
weight: 100 | ||
- destination: | ||
host: istio-host-split-canary | ||
weight: 0 | ||
|
||
--- | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Rollout | ||
metadata: | ||
name: istio-host-split | ||
spec: | ||
replicas: 4 | ||
strategy: | ||
canary: | ||
canaryService: istio-host-split-canary | ||
stableService: istio-host-split-stable | ||
trafficRouting: | ||
managedRoutes: | ||
- name: mirror-route | ||
istio: | ||
virtualService: | ||
name: istio-host-split-vsvc | ||
routes: | ||
- primary | ||
steps: | ||
- setCanaryScale: | ||
weight: 50 | ||
- setMirrorRoute: | ||
name: mirror-route | ||
percentage: 50 | ||
match: | ||
- method: | ||
exact: POST | ||
path: | ||
prefix: /color | ||
- pause: {} | ||
selector: | ||
matchLabels: | ||
app: istio-host-split | ||
template: | ||
metadata: | ||
labels: | ||
app: istio-host-split | ||
spec: | ||
containers: | ||
- name: istio-host-split | ||
image: argoproj/rollouts-demo:green | ||
ports: | ||
- name: http | ||
containerPort: 8080 | ||
protocol: TCP | ||
resources: | ||
requests: | ||
memory: 16Mi | ||
cpu: 5m | ||
|
||
--- | ||
|
||
apiVersion: networking.istio.io/v1alpha3 | ||
kind: Gateway | ||
metadata: | ||
name: istio-host-split-gateway | ||
spec: | ||
selector: | ||
istio: ingressgateway # use istio default controller | ||
servers: | ||
- port: | ||
number: 80 | ||
name: http | ||
protocol: HTTP | ||
hosts: | ||
- "istio-host-split.com" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.