0
0
Kubernetesdevops~10 mins

Pod stuck in Pending state 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 check the status of pods in the default namespace.

Kubernetes
kubectl get pods --namespace=[1]
Drag options to blanks, or click blank then click option'
Akube-system
Ball
Cdefault
Dpending
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'all' instead of a namespace
Using 'pending' which is a pod status, not a namespace
2fill in blank
medium

Complete the command to describe a pod named 'myapp-pod' to find why it is Pending.

Kubernetes
kubectl describe pod [1]
Drag options to blanks, or click blank then click option'
Apod-myapp
Bpending-pod
Cmy-pod-app
Dmyapp-pod
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect pod names
Swapping words in the pod name
3fill in blank
hard

Fix the error in this YAML snippet to request CPU resources correctly for a pod.

Kubernetes
resources:
  requests:
    cpu: [1]
Drag options to blanks, or click blank then click option'
A100m
B100
C0.1
D1000m
Attempts:
3 left
💡 Hint
Common Mistakes
Using plain numbers without units
Using decimal numbers without 'm'
4fill in blank
hard

Fill both blanks to create a node selector that schedules pods only on nodes labeled with environment=production.

Kubernetes
nodeSelector:
  [1]: [2]
Drag options to blanks, or click blank then click option'
Aenvironment
Bproduction
Cstaging
Dzone
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping key and value
Using wrong label keys or values
5fill in blank
hard

Fill all three blanks to create a pod affinity rule that prefers nodes in the 'us-east' zone with label 'zone=us-east'.

Kubernetes
affinity:
  podAffinity:
    preferredDuringSchedulingIgnoredDuringExecution:
    - weight: [1]
      podAffinityTerm:
        labelSelector:
          matchExpressions:
          - key: [2]
            operator: In
            values:
            - [3]
Drag options to blanks, or click blank then click option'
A100
Bzone
Cus-east
Denvironment
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong weight values
Using incorrect label keys or values