0
0
Kubernetesdevops~10 mins

Node selectors for simple scheduling in Kubernetes - Interactive Code Practice

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

Complete the YAML to add a node selector that schedules the pod on nodes labeled with environment=production.

Kubernetes
apiVersion: v1
kind: Pod
metadata:
  name: mypod
spec:
  containers:
  - name: mycontainer
    image: nginx
  nodeSelector:
    environment: [1]
Drag options to blanks, or click blank then click option'
Astaging
Bproduction
Cdevelopment
Dtest
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong label value like 'staging' instead of 'production'.
Forgetting to indent the nodeSelector properly in YAML.
2fill in blank
medium

Complete the YAML to schedule the pod on nodes labeled with disktype=ssd.

Kubernetes
apiVersion: v1
kind: Pod
metadata:
  name: fastpod
spec:
  containers:
  - name: fastcontainer
    image: busybox
  nodeSelector:
    disktype: [1]
Drag options to blanks, or click blank then click option'
Assd
Bnvme
Csata
Dhdd
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'hdd' which means hard disk drive instead of 'ssd'.
Misspelling the label value.
3fill in blank
hard

Fix the error in the nodeSelector to correctly schedule the pod on nodes labeled with region=us-west.

Kubernetes
apiVersion: v1
kind: Pod
metadata:
  name: regionalpod
spec:
  containers:
  - name: regionalcontainer
    image: alpine
  nodeSelector:
    region: [1]
Drag options to blanks, or click blank then click option'
Aasia-south
Bus_east
Ceu-central
Dus-west
Attempts:
3 left
💡 Hint
Common Mistakes
Using underscores instead of hyphens in region names.
Choosing a region label that does not exist on nodes.
4fill in blank
hard

Fill both blanks to schedule the pod on nodes labeled with tier=backend and environment=production.

Kubernetes
apiVersion: v1
kind: Pod
metadata:
  name: backendpod
spec:
  containers:
  - name: backendcontainer
    image: redis
  nodeSelector:
    tier: [1]
    environment: [2]
Drag options to blanks, or click blank then click option'
Abackend
Bfrontend
Cproduction
Ddevelopment
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up tier and environment values.
Using 'frontend' or 'development' instead of the correct labels.
5fill in blank
hard

Fill all three blanks to schedule the pod on nodes labeled with role=database, zone=us-central1-a, and environment=staging.

Kubernetes
apiVersion: v1
kind: Pod
metadata:
  name: dbpod
spec:
  containers:
  - name: dbcontainer
    image: postgres
  nodeSelector:
    role: [1]
    zone: [2]
    environment: [3]
Drag options to blanks, or click blank then click option'
Awebserver
Bus-central1-a
Cstaging
Ddatabase
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong role like 'webserver' instead of 'database'.
Mixing zone or environment values incorrectly.