Cheat notes · Module 07 · Traffic
Gateway API: the lighter option
A five-minute review for when you have done this module and want it back in your head. Open the full module for the steps and the lab, or the full text to print.
The idea
A mesh is not the only way to split traffic exactly. The Gateway API is a standard set of routing resources that many ingress controllers implement, Traefik included. The Argo Rollouts Gateway API plugin writes the canary weights into an HTTPRoute, so the edge splits the traffic and no pod needs a sidecar.
Remember
- Gateway API CRDs v1.5.1 (standard channel), installed from Git before Traefik: the chart does not bundle them.
- Traefik with
providers.kubernetesGateway.enabled, and its Gatewaytraefik-gatewayaccepting routes from namespaces labelledteam: checkout. - The plugin
argoproj-labs/gatewayAPIv0.17.0, named in the Rollouts values; the controller loads it at start. - HTTPRoute
checkoutwith two backends, stable and canary; the controller sets their weights. - Mesh or edge: Istio adds header routes inside the cluster and mTLS; the Gateway API is lighter and only sees traffic that enters through the gateway.
Pitfalls
- An HTTPRoute that is not
Accepted: the Gateway's namespace policy does not admit the route's namespace. - Traffic that skips the gateway (pod to pod) is not split. Only requests through the edge follow the weights.
Commands
kubectl get gatewayclass,gateway -A | Traefik's GatewayClass and Gateway |
kubectl -n argo-rollouts logs deploy/argo-rollouts | grep -i plugin | Did the plugin load? |
kubectl -n checkout-dev get httproute checkout -o jsonpath='{.spec.rules[0].backendRefs[*].weight}' | The weights right now |
curl -s http://checkout-dev.localtest.me:8088/ | jq -r .version | What users get |
checkout-config helm/dev.yaml (module 07)
replicas: 2
strategy: canary
canary:
trafficRouting: gatewayapi
steps:
- setWeight: 20 # 20% even with two pods
- pause: { duration: 1m }
- setWeight: 50
- pause: { duration: 1m }
analysis:
templates: [success-rate]
startingStep: 1
gatewayApi:
host: checkout-dev.localtest.me
Test yourself
Answer in your head first, then open the answer.
Why install the Gateway API CRDs as their own Application?
Traefik's chart does not include them, and they must exist before the Gateway and any HTTPRoute.
What does the plugin change during a release?
The weights of the stable and canary backends in the HTTPRoute.
When is Istio worth its weight over the Gateway API?
When you need header routes or exact splits inside the cluster, or mTLS between pods.
Where module 07 leaves you: Dev releases through HTTPRoute/checkout on Traefik's traefik-gateway: 20% and 50% steps with two pods, judged by success-rate. Dev is served at http://checkout-dev.localtest.me:8088 and runs 6.12.0.