0
0
Dockerdevops~20 mins

Blue-green deployment with containers in Docker - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Blue-Green Deployment Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding Blue-Green Deployment Basics

In a blue-green deployment using containers, what is the main purpose of having two identical environments (blue and green)?

ATo test new features in the blue environment while the green environment is offline
BTo run two different versions of the application simultaneously for load balancing
CTo switch traffic between two identical environments to minimize downtime during updates
DTo deploy the application in blue for development and green for production permanently
Attempts:
2 left
💡 Hint

Think about how switching environments helps users experience no downtime.

💻 Command Output
intermediate
1:30remaining
Docker Command to Switch Traffic in Blue-Green Deployment

Given two running container sets named app-blue and app-green, which Docker command output indicates that the app-green containers are now receiving traffic after switching?

Docker
docker ps --filter "name=app-green" --format "{{.Names}}: {{.Status}}"
A
app-green-1: Up 5 minutes
app-green-2: Up 5 minutes
B
app-blue-1: Up 5 minutes
app-blue-2: Up 5 minutes
C
app-green-1: Exited (0) 2 minutes ago
app-green-2: Exited (0) 2 minutes ago
D
app-blue-1: Restarting (1) 10 seconds ago
app-blue-2: Restarting (1) 10 seconds ago
Attempts:
2 left
💡 Hint

Look for containers that are running and healthy.

🔀 Workflow
advanced
2:00remaining
Correct Sequence for Blue-Green Deployment with Docker Containers

Arrange the steps in the correct order to perform a blue-green deployment using Docker containers.

A1,2,3,4
B2,1,3,4
C1,3,2,4
D3,1,2,4
Attempts:
2 left
💡 Hint

Think about deploying first, then verifying, then switching traffic, then cleaning up.

Troubleshoot
advanced
1:30remaining
Troubleshooting Traffic Not Switching in Blue-Green Deployment

After deploying the green environment and switching the load balancer to it, users still see the old version from the blue environment. What is the most likely cause?

AThe green containers failed health checks and were never marked ready by the load balancer
BThe blue containers were stopped before switching traffic
CThe DNS cache on user devices was cleared
DThe green containers are running but the load balancer configuration was not updated
Attempts:
2 left
💡 Hint

Consider what controls where user traffic is sent.

Best Practice
expert
2:00remaining
Best Practice for Database Changes in Blue-Green Deployment

When performing a blue-green deployment involving containers, what is the best practice for handling database schema changes to avoid downtime and data loss?

AApply all schema changes directly to the production database before switching environments
BUse backward-compatible schema changes and deploy application versions that support both old and new schemas
CStop all database writes during deployment to prevent conflicts
DMaintain separate databases for blue and green environments and merge data after deployment
Attempts:
2 left
💡 Hint

Think about how to keep the app running smoothly during schema updates.