In this lesson, you will learn how to shift traffic declaratively at the Ingress layer using Argo Rollouts to enable fine-grained control over your canary releases.
The Role of the Ingress Controller
While service meshes provide deep, granular traffic control, many environments rely on standard Ingress controllers (like NGINX or ALB) for routing. Argo Rollouts bridges the gap between your Rollout object and these controllers by manipulating Ingress rules during a deployment. Instead of relying solely on Kubernetes Services to load-balance between pods, Argo Rollouts updates the Ingress resource’s rules or annotations to steer traffic to your new version.
Connecting the Pieces
To enable this, your Rollout resource defines an ingress section within its strategy.canary block. When you trigger an update, the Argo Rollouts controller modifies the Ingress object to point to your new "canary" Service.
Consider this example configuration:
spec:
strategy:
canary:
ingress:
name: my-app-ingress
templateAnnotationPrefix: "nginx.ingress.kubernetes.io"
steps:
- setWeight: 20
- pause: {duration: 1m}
In this setup, the controller observes your canary steps. During the setWeight: 20 phase, the controller updates the Ingress configuration—often by modifying specific annotations (like canary weight annotations if using NGINX)—to ensure 20% of incoming traffic is routed to the new pods.
Why Use Ingress Routing?
Integrating directly with your Ingress controller is highly efficient for Layer 7 routing because it doesn't require the overhead of a service mesh. By automating the modification of your Ingress manifest, Argo Rollouts ensures that traffic shifting is synchronized with your automated analysis templates. If your health probes fail during the canary phase, the controller immediately reverts the Ingress configuration to point 100% of traffic back to the "stable" service, ensuring minimal user impact without manual intervention.
Key Takeaway: Integrating Argo Rollouts with your Ingress controller enables automated, declarative traffic shifting that leverages your existing edge infrastructure to safely manage canary deployments.