Bird
0
0

How can you combine rolling updates with health checks to ensure only healthy containers are updated?

hard📝 Application Q9 of 15
Docker - Swarm
How can you combine rolling updates with health checks to ensure only healthy containers are updated?
ADefine health checks in the service and use rolling updates; unhealthy containers won't be replaced
BRolling updates ignore health checks by default
CHealth checks must be disabled during rolling updates
DUse manual container restarts instead of rolling updates
Step-by-Step Solution
Solution:
  1. Step 1: Understand health checks in Docker services

    Health checks monitor container status; Docker uses them to decide if a container is healthy.
  2. Step 2: Combine with rolling updates

    When rolling updates run, Docker replaces only healthy containers; unhealthy ones are not updated until healthy.
  3. Final Answer:

    Define health checks in the service and use rolling updates; unhealthy containers won't be replaced -> Option A
  4. Quick Check:

    Health checks + rolling updates = safer updates [OK]
Quick Trick: Use health checks to prevent updating unhealthy containers [OK]
Common Mistakes:
  • Assuming rolling updates ignore health checks
  • Disabling health checks during updates
  • Using manual restarts instead of rolling updates

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Docker Quizzes