0
0
Kubernetesdevops~10 mins

Scaling 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 command to scale a deployment named webapp to 3 replicas.

Kubernetes
kubectl scale deployment webapp --replicas=[1]
Drag options to blanks, or click blank then click option'
A5
B0
C1
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 replicas will stop all pods.
Using a number too high may overload your cluster.
2fill in blank
medium

Complete the command to check the current number of replicas for deployment api-server.

Kubernetes
kubectl get deployment api-server -o [1]
Drag options to blanks, or click blank then click option'
Ajsonpath='{.status.replicas}'
Bwide
Cyaml
Djson
Attempts:
3 left
💡 Hint
Common Mistakes
Using wide shows more info but not just replicas.
Using yaml or json shows full details.
3fill in blank
hard

Fix the error in this command to scale deployment frontend to 4 replicas.

Kubernetes
kubectl scale deployment frontend --replicas [1]
Drag options to blanks, or click blank then click option'
Ato 4
B=4
C4
D-4
Attempts:
3 left
💡 Hint
Common Mistakes
Using '=4' sets an invalid replicas value '=4'.
Adding words like 'to' is invalid.
4fill in blank
hard

Fill both blanks to create a YAML snippet that sets replicas to 5 for a deployment.

Kubernetes
apiVersion: apps/v1
kind: Deployment
metadata:
  name: myapp
spec:
  replicas: [1]
  selector:
    matchLabels:
      app: [2]
Drag options to blanks, or click blank then click option'
A5
Bmyapp
C3
Dwebapp
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong number for replicas.
Mismatching the app label causes selector issues.
5fill in blank
hard

Fill all three blanks to create a command that scales deployment backend to 6 replicas and outputs the updated replicas count.

Kubernetes
kubectl scale deployment [1] --replicas=[2] && kubectl get deployment [3] -o jsonpath='{.status.replicas}'
Drag options to blanks, or click blank then click option'
Abackend
B6
Dfrontend
Attempts:
3 left
💡 Hint
Common Mistakes
Using different deployment names causes errors.
Mismatching replicas number causes confusion.