0
0
Dockerdevops~20 mins

Container orchestration in production in Docker - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Container Orchestration Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate
2:00remaining
What is the output of this Docker Swarm service command?
You run the command docker service ls in a Docker Swarm cluster. What output will you see if there are two services named webapp and db running with 3 and 1 replicas respectively?
Docker
docker service ls
A
ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
x1y2z3              webapp              replicated          3/3                 webapp:latest       *:80->80/tcp
x4y5z6              db                  replicated          1/1                 db:latest           
B
ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
x1y2z3              webapp              global              3/3                 webapp:latest       *:80->80/tcp
x4y5z6              db                  replicated          1/1                 db:latest           
C
ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
x1y2z3              webapp              replicated          2/3                 webapp:latest       *:80->80/tcp
x4y5z6              db                  replicated          1/1                 db:latest           
D
ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
x1y2z3              webapp              replicated          3/3                 webapp:latest       
x4y5z6              db                  replicated          1/1                 db:latest           
Attempts:
2 left
💡 Hint
Look carefully at the MODE and REPLICAS columns for each service.
🧠 Conceptual
intermediate
1:30remaining
Which orchestration feature ensures your app keeps running even if a node fails?
In container orchestration, what feature helps maintain application availability when a physical or virtual machine hosting containers crashes?
ALoad balancing
BImage caching
CService discovery
DSelf-healing
Attempts:
2 left
💡 Hint
Think about automatic recovery without manual intervention.
Configuration
advanced
2:30remaining
Identify the correct Docker Compose snippet for scaling a service
Which Docker Compose YAML snippet correctly configures the web service to run 5 replicas in a production swarm?
A
version: '3.8'
services:
  web:
    image: myapp:latest
    replicas: 5
    restart_policy:
      condition: on-failure
B
version: '3.8'
services:
  web:
    image: myapp:latest
    deploy:
      replicas: 5
      restart_policy:
        condition: on-failure
C
version: '3.8'
services:
  web:
    image: myapp:latest
    deploy:
      mode: global
      replicas: 5
D
version: '3.8'
services:
  web:
    image: myapp:latest
    deploy:
      replicas: '5'
      restart_policy:
        condition: any
Attempts:
2 left
💡 Hint
Replicas must be under deploy and be a number, not a string.
Troubleshoot
advanced
2:00remaining
Why does this Kubernetes pod stay in Pending state?
You deployed a pod with this YAML snippet but it stays in Pending state indefinitely. What is the most likely cause?
apiVersion: v1
kind: Pod
metadata:
  name: test-pod
spec:
  containers:
  - name: test-container
    image: nginx
  nodeSelector:
    disktype: ssd
ANo nodes in the cluster have the label <code>disktype=ssd</code>
BThe image <code>nginx</code> is not available in the registry
CThe pod spec is missing resource limits
DThe pod name is invalid
Attempts:
2 left
💡 Hint
Check if the node labels match the pod's nodeSelector.
🔀 Workflow
expert
3:00remaining
Order the steps to safely update a production Kubernetes deployment with zero downtime
Arrange these steps in the correct order to perform a rolling update on a Kubernetes deployment ensuring zero downtime.
A1,2,4,3
B2,1,3,4
C1,2,3,4
D1,3,2,4
Attempts:
2 left
💡 Hint
Think about editing first, then applying, then monitoring, then verifying.