0
0
Kubernetesdevops~10 mins

Canary deployments 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 deployment strategy as Canary in the Kubernetes deployment manifest.

Kubernetes
strategy:
  type: [1]
Drag options to blanks, or click blank then click option'
ARollingUpdate
BCanary
CBlueGreen
DRecreate
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'RollingUpdate' instead of 'Canary' for canary deployments.
Using 'Recreate' which deletes all old pods before starting new ones.
2fill in blank
medium

Complete the code to define the percentage of traffic routed to the canary version.

Kubernetes
spec:
  strategy:
    canary:
      trafficPercentage: [1]
Drag options to blanks, or click blank then click option'
A0
B100
C10
D50
Attempts:
3 left
💡 Hint
Common Mistakes
Setting trafficPercentage to 100, which sends all traffic to canary immediately.
Setting trafficPercentage to 0, which sends no traffic to canary.
3fill in blank
hard

Fix the error in the command to apply the canary deployment manifest.

Kubernetes
kubectl [1] -f canary-deployment.yaml
Drag options to blanks, or click blank then click option'
Adelete
Bdescribe
Cget
Dapply
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'delete' which removes resources instead of creating/updating.
Using 'get' which only retrieves information.
4fill in blank
hard

Fill both blanks to define a canary deployment with 3 replicas and 20% traffic.

Kubernetes
spec:
  replicas: [1]
  strategy:
    canary:
      trafficPercentage: [2]
Drag options to blanks, or click blank then click option'
A3
B5
C20
D50
Attempts:
3 left
💡 Hint
Common Mistakes
Setting replicas too high for initial canary testing.
Setting trafficPercentage too high, risking full traffic shift.
5fill in blank
hard

Fill all three blanks to create a canary deployment manifest snippet with label 'app: web', 4 replicas, and 15% traffic.

Kubernetes
metadata:
  labels:
    app: [1]
spec:
  replicas: [2]
  strategy:
    canary:
      trafficPercentage: [3]
Drag options to blanks, or click blank then click option'
Aweb
B4
C15
Dapi
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong label values that don't match selectors.
Setting replicas or trafficPercentage incorrectly.