0
0
Kubernetesdevops~20 mins

Recreate update strategy in Kubernetes - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Recreate Update Strategy Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
2:00remaining
What happens during a Recreate update strategy in Kubernetes?

In Kubernetes, when you use the Recreate update strategy for a Deployment, what is the behavior during an update?

AKubernetes deletes all existing pods before creating new ones.
BKubernetes creates new pods first, then deletes old pods after they are ready.
CKubernetes updates pods one by one without downtime.
DKubernetes scales up new pods and keeps old pods running indefinitely.
Attempts:
2 left
💡 Hint

Think about whether old pods and new pods run at the same time or not.

💻 Command Output
intermediate
2:00remaining
Output of Deployment with Recreate strategy during update

Given this Deployment YAML snippet using Recreate strategy, what will be the status of pods during an update?

Kubernetes
strategy:
  type: Recreate
AOld pods and new pods run simultaneously during update.
BPods are updated one at a time with zero downtime.
COld pods are terminated before new pods start; no pods run simultaneously.
DNew pods start first, then old pods terminate after readiness.
Attempts:
2 left
💡 Hint

Recreate means 'remove then create'.

Configuration
advanced
2:30remaining
Correct YAML for Recreate update strategy

Which YAML snippet correctly configures a Deployment to use the Recreate update strategy?

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

Look for the correct field name and value for Recreate.

Troubleshoot
advanced
2:30remaining
Why does a Deployment with Recreate strategy cause downtime?

You notice your application becomes unavailable during Deployment updates using the Recreate strategy. Why does this happen?

ABecause all old pods are deleted before new pods start, causing downtime.
BBecause new pods fail to start due to resource limits.
CBecause pods are updated one by one, causing slow rollout.
DBecause the Deployment uses RollingUpdate strategy instead.
Attempts:
2 left
💡 Hint

Think about pod availability during the update process.

Best Practice
expert
3:00remaining
When to prefer Recreate update strategy over RollingUpdate?

In which scenario is using the Recreate update strategy recommended instead of RollingUpdate?

AWhen zero downtime is critical for the application.
BWhen the application cannot handle multiple versions running simultaneously.
CWhen you want to update pods gradually without downtime.
DWhen you want to scale pods automatically based on load.
Attempts:
2 left
💡 Hint

Consider application compatibility with multiple versions running at once.