0
0
Kubernetesdevops~20 mins

Deployment as higher-level abstraction in Kubernetes - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Deployment Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What is the primary purpose of a Kubernetes Deployment?

Choose the main function of a Deployment in Kubernetes.

ATo expose Pods to external traffic via a stable IP address
BTo manage the lifecycle of Pods and ensure the desired number of replicas are running
CTo store configuration data for Pods and containers
DTo schedule Pods onto specific nodes based on resource availability
Attempts:
2 left
💡 Hint

Think about what keeps your app running smoothly even if some parts fail.

💻 Command Output
intermediate
2:00remaining
Output of 'kubectl get deployment myapp' after scaling

What is the output of the following command after scaling the Deployment to 3 replicas?

kubectl get deployment myapp
A
NAME   READY   UP-TO-DATE   AVAILABLE   AGE
myapp  0/3     0            0           10m
B
NAME   READY   UP-TO-DATE   AVAILABLE   AGE
myapp  1/3     3            1           10m
C
NAME   READY   UP-TO-DATE   AVAILABLE   AGE
myapp  3/3     3            3           10m
DError from server (NotFound): deployments.apps "myapp" not found
Attempts:
2 left
💡 Hint

Scaling to 3 replicas means all 3 should be ready and available.

Configuration
advanced
2:30remaining
Correct YAML snippet for a Deployment with rolling update strategy

Which YAML snippet correctly configures a Deployment to use a rolling update strategy with max 1 unavailable Pod?

A
strategy:
  type: RollingUpdate
  rollingUpdate:
    maxUnavailable: 1
B
strategy:
  type: Recreate
  rollingUpdate:
    maxUnavailable: 1
C
strategy:
  type: RollingUpdate
  rollingUpdate:
    maxSurge: 0
D
strategy:
  type: RollingUpdate
  rollingUpdate:
    maxUnavailable: 0
    maxSurge: 2
Attempts:
2 left
💡 Hint

RollingUpdate with maxUnavailable controls how many Pods can be down during update.

Troubleshoot
advanced
2:30remaining
Why does a Deployment keep creating new Pods endlessly?

You notice your Deployment keeps creating new Pods and old ones are terminating repeatedly. What is the most likely cause?

AThe Deployment has no replicas specified, so it keeps creating Pods
BThe nodes have insufficient resources causing Pods to crash
CThe Service selector does not match the Pod labels
DThe Pod template spec has changed causing a new ReplicaSet to be created each time
Attempts:
2 left
💡 Hint

Think about what triggers a new ReplicaSet creation in a Deployment.

🔀 Workflow
expert
3:00remaining
Order the steps to perform a zero-downtime Deployment update

Arrange the steps in the correct order to update a Deployment without downtime.

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

Think about the natural flow from editing to applying and then Kubernetes handling the rollout.