0
0
Dockerdevops~20 mins

Canary deployment pattern in Docker - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Canary Deployment Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What is the main purpose of a canary deployment?

Choose the best description of the canary deployment pattern in software delivery.

ARun two versions of software simultaneously for load balancing
BDeploy all changes to production at once to minimize downtime
CGradually roll out a new version to a small subset of users before full deployment
DAutomatically rollback all changes after deployment without testing
Attempts:
2 left
💡 Hint

Think about how to reduce risk when releasing new software.

💻 Command Output
intermediate
1:30remaining
What is the output of this Docker command during canary deployment?

Given the command below, what will it show?

docker service ls --filter name=myapp_canary
ALists all running services including the canary version named 'myapp_canary'
BShows an error because the filter syntax is incorrect
CLists only services not related to 'myapp_canary'
DShows no output because no services exist
Attempts:
2 left
💡 Hint

Check how Docker filters services by name.

Configuration
advanced
2:00remaining
Which Docker Compose snippet correctly defines a canary deployment with 10% traffic?

Choose the correct Docker Compose service configuration to deploy a canary version receiving 10% of traffic using Docker Swarm.

Docker
version: '3.8'
services:
  web:
    image: myapp:stable
    deploy:
      replicas: 9
  web_canary:
    image: myapp:canary
    deploy:
      replicas: 1
AThe snippet above correctly sets 9 stable and 1 canary replica for 10% traffic
BThe canary service must have replicas: 0.1 to get 10% traffic
CThe snippet should use 'mode: global' for canary to get 10% traffic
DTraffic split is controlled by 'update_config' not replicas count
Attempts:
2 left
💡 Hint

Think about how replica counts relate to traffic distribution in Docker Swarm.

Troubleshoot
advanced
2:00remaining
Why does the canary deployment not receive any traffic despite correct replica settings?

You deployed a canary service with 1 replica alongside 9 stable replicas. However, no user traffic reaches the canary. What is the most likely cause?

AThe stable service has zero replicas running
BThe canary service image is missing from the registry
CDocker Swarm does not support multiple replicas
DThe load balancer is not configured to route traffic to the canary service
Attempts:
2 left
💡 Hint

Consider how traffic routing works in a multi-service deployment.

🔀 Workflow
expert
2:30remaining
Order the steps for a safe canary deployment using Docker and monitoring tools

Arrange these steps in the correct order to perform a canary deployment safely.

A2,1,3,4
B1,3,2,4
C1,2,3,4
D3,1,2,4
Attempts:
2 left
💡 Hint

Think about deploying first, then routing traffic, monitoring, and finally full rollout.