Skip to content

kostis-codefresh/rollouts-header-routing-example

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Static and Dynamic routing for Canaries with Argo Rollouts

This repository contains 3 examples for using Traefik 3.x with Argo Rollouts via the Gateway API

  1. Example with just a route
  2. Example with static routes for preview/stable/canary
  3. Example with header based routing.

Read the full blog at https://codefresh.io/blog/argo-rollouts-header-based-routing/

Traefik setup

This process is common to both examples.

Install traefik 3.x, Argo Rollouts and the Gateway API plugin as described traefik-setup/README.md in a local Kubernetes cluster.

Expose the Traefik endpoint as Load Balancer so you can visit it via the browser.

Simple HTTP route example

To test just the Gateway API implementation of Traefik apply the manifests at simple folder. Then visit http://localhost/example/ to see the application.

Static routing example

Apply the manifests in the static-routing folder. Then start a canary by editing the rollout.yml file and change the docker image to different tags.

Then visit the 3 urls

  • http://localhost/stable/ This is always old version
  • http://localhost/canary/ This is active canary version
  • http://localhost/preview/ This is always new version

You can inspect the rollout with

kubectl argo rollouts get rollout static-rollouts-demo

Dynamic routing example

Apply the manifests in the dynamic-routing folder. Then start a canary by editing the rollout.yml file and change the APP_VERSION and APP_COLOR to start a canary

Then visit http://localhost and see that if you change the active header on the UI, the application can be forced to be part of the canary.

You can inspect the rollout with

kubectl argo rollouts get rollout smart-rollouts-demo

Kubecon Presentation for Header Based Routing

If you prefer video format see the Kubecon Presentation.

About

Example with Argo Rollouts and Header based routing

Topics

Resources

Stars

Watchers

Forks