0
0
Kubernetesdevops~10 mins

Recreate update strategy in Kubernetes - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the update strategy as Recreate in a Deployment manifest.

Kubernetes
strategy:
  type: [1]
Drag options to blanks, or click blank then click option'
ARecreate
BOnDelete
CRollingUpdate
DBlueGreen
Attempts:
3 left
💡 Hint
Common Mistakes
Using RollingUpdate instead of Recreate causes pods to update gradually.
Using OnDelete requires manual pod deletion, not automatic updates.
2fill in blank
medium

Complete the Deployment YAML snippet to set the update strategy to Recreate.

Kubernetes
apiVersion: apps/v1
kind: Deployment
metadata:
  name: my-app
spec:
  replicas: 3
  [1]:
    type: Recreate
Drag options to blanks, or click blank then click option'
Aselector
Btemplate
Cstrategy
DreplicaSet
Attempts:
3 left
💡 Hint
Common Mistakes
Placing 'type: Recreate' under 'selector' or 'template' causes errors.
Missing the 'strategy' field means default RollingUpdate is used.
3fill in blank
hard

Fix the error in the Deployment YAML to use the Recreate update strategy correctly.

Kubernetes
spec:
  replicas: 2
  strategy:
    [1]: Recreate
Drag options to blanks, or click blank then click option'
AstrategyType
Bmode
CupdateStrategy
Dtype
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'mode' or 'updateStrategy' instead of 'type' causes the strategy to be ignored.
Misspelling 'type' leads to default RollingUpdate.
4fill in blank
hard

Fill both blanks to complete the Deployment spec that uses Recreate strategy and sets replicas to 4.

Kubernetes
spec:
  replicas: [1]
  strategy:
    type: [2]
Drag options to blanks, or click blank then click option'
A4
BRollingUpdate
CRecreate
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Using RollingUpdate instead of Recreate changes update behavior.
Setting replicas to 3 instead of 4 does not match the requirement.
5fill in blank
hard

Fill all three blanks to create a Deployment spec with 2 replicas, Recreate update strategy, and a matchLabels selector.

Kubernetes
spec:
  replicas: [1]
  selector:
    matchLabels:
      app: [2]
  strategy:
    type: [3]
Drag options to blanks, or click blank then click option'
Amy-app
B2
CRecreate
DRollingUpdate
Attempts:
3 left
💡 Hint
Common Mistakes
Using RollingUpdate instead of Recreate changes update behavior.
Mixing up replicas and label values.