0
0
Kubernetesdevops~20 mins

Storage classes for dynamic provisioning in Kubernetes - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Storage Provisioning Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
What is the main purpose of a StorageClass in Kubernetes?

Choose the best description of what a StorageClass does in Kubernetes dynamic provisioning.

ASchedules pods to nodes based on resource availability.
BDefines how to dynamically create persistent storage volumes with specific parameters.
CManages user access control for Kubernetes clusters.
DSpecifies the network policies for pod communication.
Attempts:
2 left
💡 Hint

Think about what StorageClass controls related to storage.

💻 Command Output
intermediate
1:30remaining
Output of kubectl get storageclass command

What output will you see after running kubectl get storageclass if there is one default StorageClass named fast-storage?

Kubernetes
kubectl get storageclass
A
NAME           PROVISIONER                RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
slow-storage   kubernetes.io/gce-pd       Delete         Immediate             true                  5d
B
NAME           PROVISIONER                RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
fast-storage   kubernetes.io/aws-ebs      Retain         Immediate             false                 10d
C
NAME           PROVISIONER                RECLAIMPOLICY   VOLUMEBINDINGMODE   ALLOWVOLUMEEXPANSION   AGE
fast-storage   kubernetes.io/aws-ebs      Delete         WaitForFirstConsumer   true                  10d
(default)
DNo resources found in default namespace.
Attempts:
2 left
💡 Hint

Look for the default StorageClass and its typical fields.

Configuration
advanced
2:00remaining
Identify the error in this StorageClass YAML

Which option correctly identifies the error in this StorageClass YAML snippet?

Kubernetes
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
  name: fast-storage
provisioner: kubernetes.io/aws-ebs
parameters:
  type: gp2
reclaimPolicy: Delete
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: yes
AThe provisioner 'kubernetes.io/aws-ebs' is invalid and should be 'aws-ebs-provisioner'.
BThe volumeBindingMode 'WaitForFirstConsumer' is deprecated and should be 'Immediate'.
CThe reclaimPolicy field should be under parameters, not at root level.
DThe value 'yes' for allowVolumeExpansion should be a boolean true, not a string.
Attempts:
2 left
💡 Hint

Check the data types for boolean fields in YAML.

Troubleshoot
advanced
2:00remaining
Why does PVC remain Pending with dynamic provisioning?

A PersistentVolumeClaim (PVC) stays in Pending state even though a StorageClass is specified. What is the most likely cause?

AThe StorageClass provisioner is not installed or available in the cluster.
BThe PVC size is larger than the node's CPU capacity.
CThe PVC does not specify a storageClassName field.
DThe pod using the PVC is not scheduled yet.
Attempts:
2 left
💡 Hint

Think about what happens when Kubernetes tries to create a volume dynamically.

🔀 Workflow
expert
2:30remaining
Correct order to create and use dynamic storage in Kubernetes

Put these steps in the correct order to dynamically provision storage and use it in a pod.

A1,2,4,3
B2,1,4,3
C1,4,2,3
D2,4,1,3
Attempts:
2 left
💡 Hint

Think about what must exist before requesting storage and before using it in a pod.