0
0
Kubernetesdevops~10 mins

Creating Deployments with YAML in Kubernetes - Interactive Practice

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

Complete the code to specify the kind of Kubernetes object.

Kubernetes
apiVersion: apps/v1
kind: [1]
metadata:
  name: my-deployment
Drag options to blanks, or click blank then click option'
AConfigMap
BService
CDeployment
DPod
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'Pod' instead of 'Deployment' will create a single pod, not a deployment.
Using 'Service' will create a network endpoint, not a deployment.
2fill in blank
medium

Complete the code to set the number of pod replicas.

Kubernetes
spec:
  replicas: [1]
  selector:
    matchLabels:
      app: myapp
Drag options to blanks, or click blank then click option'
A3
Bten
Czero
D-1
Attempts:
3 left
💡 Hint
Common Mistakes
Using words like 'ten' instead of numbers causes errors.
Negative numbers are not allowed for replicas.
3fill in blank
hard

Fix the error in the container image name.

Kubernetes
containers:
- name: myapp-container
  image: [1]
Drag options to blanks, or click blank then click option'
Anginx/latest
Bnginx:latest
Cnginx latest
Dnginx_latest
Attempts:
3 left
💡 Hint
Common Mistakes
Using slash '/' instead of colon ':' causes image pull errors.
Using spaces in image names is invalid.
4fill in blank
hard

Fill both blanks to correctly specify container ports and labels.

Kubernetes
spec:
  template:
    metadata:
      labels:
        app: [1]
    spec:
      containers:
      - name: myapp-container
        image: nginx:latest
        ports:
        - containerPort: [2]
Drag options to blanks, or click blank then click option'
Amyapp
B80
C8080
Dwebapp
Attempts:
3 left
💡 Hint
Common Mistakes
Using different labels breaks pod selection.
Using wrong port numbers causes connection issues.
5fill in blank
hard

Fill all three blanks to complete the deployment spec with correct keys and values.

Kubernetes
apiVersion: apps/v1
kind: Deployment
metadata:
  name: [1]
spec:
  replicas: [2]
  selector:
    matchLabels:
      app: [3]
Drag options to blanks, or click blank then click option'
Amy-deployment
B3
Cmyapp
Ddefault
Attempts:
3 left
💡 Hint
Common Mistakes
Mismatched labels cause deployment to fail selecting pods.
Using zero or negative replicas stops pods from running.