A StorageClass defines how a unit of storage is dynamically provisioned in Kubernetes. It specifies the type of storage (like SSD or HDD), the provisioner, and parameters for creating persistent volumes automatically.
Click to reveal answer
beginner
How does dynamic provisioning work with StorageClasses?
When a PersistentVolumeClaim requests storage with a StorageClass, Kubernetes uses the StorageClass's provisioner to create a PersistentVolume automatically without manual admin intervention.
Click to reveal answer
intermediate
What key fields are defined in a StorageClass YAML?
Key fields include: - provisioner: the plugin that creates storage - parameters: settings for the storage - reclaimPolicy: what happens to storage after release - volumeBindingMode: when volume binding happens
Click to reveal answer
intermediate
What is the purpose of the reclaimPolicy in a StorageClass?
The reclaimPolicy tells Kubernetes what to do with the storage after the PersistentVolumeClaim is deleted. Common values are Delete (storage is deleted) or Retain (storage is kept for manual cleanup).
Click to reveal answer
beginner
Give an example of a common provisioner used in StorageClasses.
A common provisioner is kubernetes.io/aws-ebs for AWS Elastic Block Store, or kubernetes.io/gce-pd for Google Cloud Persistent Disk. These provisioners create cloud storage volumes dynamically.
Click to reveal answer
What does a StorageClass in Kubernetes define?
ANetwork policies for pods
BUser permissions for storage access
CHow storage volumes are dynamically created
DContainer image versions
✗ Incorrect
A StorageClass defines how storage volumes are dynamically provisioned in Kubernetes.
Which field in a StorageClass specifies the plugin to create storage?
Aparameters
BreclaimPolicy
CvolumeBindingMode
Dprovisioner
✗ Incorrect
The provisioner field specifies the plugin that creates the storage volume.
What happens if reclaimPolicy is set to Delete?
AStorage volume is kept after claim deletion
BStorage volume is deleted after claim deletion
CStorage volume is backed up automatically
DStorage volume is resized automatically
✗ Incorrect
Delete means the storage volume is deleted when the PersistentVolumeClaim is deleted.
Dynamic provisioning eliminates the need for:
AManual creation of PersistentVolumes
BUsing PersistentVolumeClaims
CDefining StorageClasses
DPod scheduling
✗ Incorrect
Dynamic provisioning automatically creates PersistentVolumes, so admins don't create them manually.
Which of these is NOT a typical parameter in a StorageClass?
Apod CPU limits
Btype of disk (SSD/HDD)
Cprovisioner plugin name
Dreclaim policy
✗ Incorrect
Pod CPU limits are unrelated to StorageClass parameters.
Explain how StorageClasses enable dynamic provisioning in Kubernetes.
Think about how storage is created automatically when requested.
You got /4 concepts.
Describe the role of reclaimPolicy in a StorageClass and its common values.
Consider what happens to storage after you stop using it.
You got /3 concepts.
Practice
(1/5)
1. What is the main purpose of a StorageClass in Kubernetes?
easy
A. To define how storage volumes are dynamically provisioned
B. To schedule pods on specific nodes
C. To manage network policies
D. To configure container resource limits
Solution
Step 1: Understand StorageClass role
A StorageClass defines parameters for dynamic volume provisioning in Kubernetes.
Step 2: Compare with other options
Scheduling pods, managing network policies, and resource limits are unrelated to StorageClass.
Final Answer:
To define how storage volumes are dynamically provisioned -> Option A
Quick Check:
StorageClass = dynamic provisioning [OK]
Hint: StorageClass controls storage creation, not pods or network [OK]
What will happen when a PersistentVolumeClaim requests storage from this class?
medium
A. The volume will not be dynamically provisioned; manual provisioning is required
B. The volume will be deleted automatically when released
C. The volume will be dynamically provisioned immediately
D. The volume will be provisioned but bound immediately without waiting
Solution
Step 1: Analyze provisioner field
The provisioner is kubernetes.io/no-provisioner, meaning no dynamic provisioning.
Step 2: Understand reclaimPolicy and binding mode
ReclaimPolicy is Retain (volume kept after release), and volumeBindingMode waits for pod scheduling.
Final Answer:
The volume will not be dynamically provisioned; manual provisioning is required -> Option A
Quick Check:
No provisioner = manual provisioning [OK]
Hint: No provisioner means no dynamic provisioning [OK]
Common Mistakes:
Assuming dynamic provisioning happens with no-provisioner
Confusing reclaimPolicy with provisioning behavior
Ignoring volumeBindingMode effect
4. You created a StorageClass with volumeBindingMode: Immediate but your pods fail to schedule because volumes are not available in the node's zone. What is the likely cause and fix?
medium
A. Cause: StorageClass name mismatch; Fix: Correct PVC storageClassName
B. Cause: Reclaim policy is Retain; Fix: Change to Delete
C. Cause: Provisioner is missing; Fix: Add a provisioner
D. Cause: Immediate binding ignores pod location; Fix: Change to WaitForFirstConsumer
Solution
Step 1: Understand volumeBindingMode impact
Immediate binding provisions and binds volume before pod scheduling, ignoring node zone.
Step 2: Identify fix
Changing to WaitForFirstConsumer delays binding until pod scheduling, ensuring volume is in correct zone.
Final Answer:
Cause: Immediate binding ignores pod location; Fix: Change to WaitForFirstConsumer -> Option D
Quick Check:
Immediate binding ignores pod zone [OK]
Hint: Use WaitForFirstConsumer to bind volume after pod scheduling [OK]
Common Mistakes:
Changing reclaimPolicy instead of binding mode
Adding provisioner when already present
Fixing storageClassName without checking binding mode
5. You want to create a StorageClass that dynamically provisions SSD-backed volumes with fast performance, deletes volumes when released, and delays binding until pod scheduling. Which YAML snippet correctly implements this?
hard
A. apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: fast-ssd
provisioner: kubernetes.io/aws-ebs
parameters:
type: standard
reclaimPolicy: Retain
volumeBindingMode: Immediate