Skip to content

Latest commit

 

History

History
104 lines (76 loc) · 3.58 KB

File metadata and controls

104 lines (76 loc) · 3.58 KB

02 – Continuous Deployment (CD)

Automating deployments, promotions across environments, and using different strategies like rolling or canary.

Table of Contents

  1. Promotion Across Environments
  2. K8s Deployment Strategies (Rolling, Blue/Green, Canary)
  3. Examples of Blue/Green & Canary
  4. Bonus: Canary/Blue-Green in Kubernetes
  5. Argo Rollouts Explanation
  6. Scenario: Slow Canary Deployments with Argo Rollouts

1) Promotion Across Environments

Question:
You have dev, staging, and prod environments. How would you automate moving a service from dev to staging, then on to prod, with proper checks along the way?

Hints / Key Points
  • Multi-stage pipeline with approvals or gating (manual or automated).
  • Same config, but different overrides for each environment (Helm or plain YAML).
  • Possibly a final manual step for production if your org requires it.

2) K8s Deployment Strategies (Rolling, Blue/Green, Canary)

Question:
You want minimal downtime and easy rollback. Compare rolling updates, blue/green deployments, and canary releases.

Hints / Key Points
  • Rolling: Replaces pods one by one; simpler to set up but partial downtime if something goes wrong mid-roll.
  • Blue/Green: Parallel environments; easy rollback by flipping traffic back.
  • Canary: Gradual traffic shift, letting you observe performance in real time with a fraction of traffic.

3) Examples of Blue/Green & Canary

Question (Scenario):
Your new microservice is critical, and you’re debating between blue/green and canary. Give a quick example of each strategy to show how you’d roll out a new version.

Hints / Key Points
  • Blue/Green:

    • Deploy new version in parallel (green).
    • Test it, switch traffic once stable.
    • Rollback by switching to old (blue) if needed.
  • Canary:

    • Send small % of traffic to new version.
    • Watch metrics, gradually increase if stable.
    • Roll back if problems arise.

4) Bonus: Canary/Blue-Green in Kubernetes

Question:
Can you do canary or blue-green deployments directly in Kubernetes without extra tools?

Hints / Key Points
  • Yes, but you have to handle traffic splits, labels, or separate services yourself.
  • Tools like Argo Rollouts or a service mesh (Istio) make it easier.

5) Argo Rollouts Explanation

Question:
What is Argo Rollouts, and how does it help with advanced deployment strategies?

Hints / Key Points
  • Kubernetes controller that replaces Deployments with CRDs.
  • Supports canary, blue-green, progressive rollouts with health checks.
  • Integrates with ingress controllers or service meshes for traffic shaping.

6) Scenario: Slow Canary Deployments with Argo Rollouts

Question:
You set up Argo Rollouts for canary deployments, but traffic shifting is slower than expected, delaying the rollout.

  • What steps do you take to debug this behavior?
  • How can you ensure canary traffic shifts happen faster?
Hints / Key Points
  • Check the Rollout object for correct strategy, weights, and health checks.
  • Make sure the ingress or service mesh is applying traffic splits properly.
  • Validate that health checks or success criteria aren’t too strict, causing slow or paused progress.
  • Monitor logs or metrics to see if pods are failing readiness or not meeting thresholds.