-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Kostis Kapelonis <[email protected]>
- Loading branch information
1 parent
ffddf86
commit b041236
Showing
3 changed files
with
921 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,111 @@ | ||
# Using Multiple Routes | ||
|
||
!!! warning | ||
Page under construction. | ||
|
||
The Gateway plugin can control more than one HTTP routes during a canary. | ||
This is a very common scenario if you have micro-services and the same application can be accessed by different routes. | ||
|
||
To be written | ||
|
||
![multiple routes](../images/multiple-routes/multiple-routes.png) | ||
|
||
As an example you have application A that uses application C at `backend.example.com` while application B also depends on C but this time as `api.example.com` | ||
|
||
You want to perform a canary deployment for application C so it is crucial that during the canary both HTTP routes change weights. | ||
|
||
First you define the two HTTP routes | ||
|
||
```yaml | ||
--- | ||
kind: HTTPRoute | ||
apiVersion: gateway.networking.k8s.io/v1beta1 | ||
metadata: | ||
name: backend-route | ||
namespace: default | ||
spec: | ||
parentRefs: | ||
- name: eg | ||
hostnames: | ||
- backend.example.com | ||
rules: | ||
- matches: | ||
- path: | ||
type: PathPrefix | ||
value: / | ||
backendRefs: | ||
- name: argo-rollouts-stable-service | ||
kind: Service | ||
port: 80 | ||
- name: argo-rollouts-canary-service | ||
kind: Service | ||
port: 80 | ||
--- | ||
kind: HTTPRoute | ||
apiVersion: gateway.networking.k8s.io/v1beta1 | ||
metadata: | ||
name: api-route | ||
namespace: default | ||
spec: | ||
parentRefs: | ||
- name: eg | ||
hostnames: | ||
- api.example.com | ||
rules: | ||
- matches: | ||
- path: | ||
type: PathPrefix | ||
value: / | ||
backendRefs: | ||
- name: argo-rollouts-stable-service | ||
kind: Service | ||
port: 80 | ||
- name: argo-rollouts-canary-service | ||
kind: Service | ||
port: 80 | ||
``` | ||
Then in your Rollout definition you use the `httproutes` property that | ||
accepts a list of routes to be controlled. | ||
|
||
```yaml | ||
apiVersion: argoproj.io/v1alpha1 | ||
kind: Rollout | ||
metadata: | ||
name: rollouts-demo | ||
namespace: default | ||
spec: | ||
replicas: 5 | ||
strategy: | ||
canary: | ||
canaryService: argo-rollouts-canary-service | ||
stableService: argo-rollouts-stable-service | ||
trafficRouting: | ||
plugins: | ||
argoproj-labs/gatewayAPI: | ||
httpRoutes: | ||
- name: backend-route | ||
- name: api-route | ||
namespace: default | ||
steps: | ||
- setWeight: 10 | ||
- pause: {} | ||
- setWeight: 50 | ||
- pause: {} | ||
- setWeight: 100 | ||
- pause: {} | ||
revisionHistoryLimit: 2 | ||
selector: | ||
matchLabels: | ||
app: rollouts-demo | ||
template: | ||
metadata: | ||
labels: | ||
app: rollouts-demo | ||
spec: | ||
containers: | ||
- name: rollouts-demo | ||
image: <my-image:my-tag> | ||
ports: | ||
- name: http | ||
containerPort: 8080 | ||
protocol: TCP | ||
``` | ||
|
||
If you now start a canary deployment both routes will change to 10%, 50% and 100% as the canary progresses to all its steps. |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.