EKS Cluster: Part 15.60 – Argo Rollouts, Automated Rollback

Series of blog posts show progress of updating/adding to EKS Cluster, this post covers adding Argo Rollouts.

Argo Rollouts:

  • Then build progressive delivery
    • Install Argo Rollouts through Argo CD.
    • Convert the Gateway demo Deployment into a Rollout.
    • Demonstrate blue/green deployment.
    • Add canary releases.
    • Connect Rollouts to Gateway API.
    • Add Prometheus analysis.
    • Deploy an intentionally unhealthy version.
    • Demonstrate automated rollback.

Phase 4: Add automatic failure protection and rollback.

  • Instead of place an CLI command, well bake it in for automatic abort for a new version that is not healthy.

Enable Automatic Abort

apps/rollouts-demo/rollout.yaml

  • Argo Rollouts defaults the deadline to ten minutes and does not automatically abort unless progressDeadlineAbort is enabled. Time spent intentionally paused does not count against the progress deadline.
 ======================================
 # A release must demonstrate progress within two minutes.
  progressDeadlineSeconds: 120

  # Automatically abort the new release when the deadline expires.
  progressDeadlineAbort: true
======================================
grep -n \
  -E 'image:|progressDeadline' \
  apps/rollouts-demo/rollout.yaml
  • Confirm it updated
======================================
grep -n -E 'image:|progressDeadline' apps/rollouts-demo/rollout.yaml
22: progressDeadlineSeconds: 120
25: progressDeadlineAbort: true
49: image: argoproj/rollouts-demo:yellow
======================================
kubectl get rollout rollouts-demo -n rollouts-demo -o json | jq '{
progressDeadlineSeconds: .spec.progressDeadlineSeconds,
progressDeadlineAbort: .spec.progressDeadlineAbort,
image: .spec.template.spec.containers[0].image,
phase: .status.phase
}'
{
"progressDeadlineSeconds": 120,
"progressDeadlineAbort": true,
"image": "argoproj/rollouts-demo:yellow",
"phase": "Healthy"
}
======================================

Ooops, i Broke it again..

apps/rollouts-demo/rollout.yaml

  • Strike this loser out, come on Troy – destroy video boy…
  • Ahem – basically what Im saying is just change the image to some BS image…
======================================
containers:
- name: rollouts-demo
image: argoproj/rollouts-demo:automatic-rollback-test
imagePullPolicy: IfNotPresent
======================================

Observe the failed canary:

  • In the CLI or K9s – You should expect the following sequence
    • Argo CD applies the broken image.
    • A new ReplicaSet is created.
    • The new canary pod enters ImagePullBackOff.
    • The stable yellow pods remain available.
    • After approximately 120 seconds without progress, Argo Rollouts automatically aborts the update.
    • The failed ReplicaSet is scaled dow
======================================
kubectl argo rollouts get rollout rollouts-demo \
-n rollouts-demo \
--watch
======================================
  • Dont be alarmed if you notice degraded, Git still request the broken image – even though yellow remains.

Revert back to Yellow:

Leave a Reply