Module Review: Storage

Key Takeaways

  1. Storage is Hard: Pods are ephemeral; Storage must be persistent. This lifecycle mismatch is solved by decoupling PV (Infrastructure) from PVC (Request).
  2. Access Modes Matter: ReadWriteOnce (Block) vs ReadWriteMany (NFS). You cannot mount an EBS volume on 5 nodes simultaneously.
  3. Use Storage Classes: Never create PVs manually. Use StorageClass to dynamically provision cloud resources.
  4. StatefulSets for Identity: Use StatefulSets for databases that require stable network IDs (web-0) and persistent storage (pvc-web-0).
  5. CSI is the Standard: The Container Storage Interface allows Kubernetes to talk to any storage vendor (AWS, Azure, NetApp) without core code changes.

Module Review: Storage

[!NOTE] This module explores the core principles of Module Review: Storage, deriving solutions from first principles and hardware constraints to build world-class, production-ready expertise.

1. Interactive Flashcards

Test your knowledge of Kubernetes Storage concepts.

What is the difference between PV and PVC?
PV is the physical resource (Cluster Admin). PVC is the request for that resource (Developer).
Which Access Mode allows multiple nodes to write simultaneously?
ReadWriteMany (RWX). Typically provided by NFS, EFS, or CephFS.
Why use a StatefulSet instead of a Deployment for a database?
StatefulSets provide stable network identity (pod-0), ordered startup/shutdown, and unique persistent storage per replica.
What component creates the actual EBS volume in AWS?
The CSI Controller Plugin (Provisioner) running on the control plane.
What happens to data when a Pod using `emptyDir` is restarted?
If restarted on the SAME node, data survives. If rescheduled to a NEW node (or Pod deleted), data is LOST.

2. Storage Cheat Sheet

Feature Use Case YAML Kind
Request Storage Developer needs 10Gi disk PersistentVolumeClaim
Provide Storage Admin defines available disk PersistentVolume
Automate Creation Auto-create disk on demand StorageClass
Replicated DB MongoDB, Cassandra, Kafka StatefulSet
Shared Files Web assets, Configs RWX Volume (NFS)
High Performance Database Data Dir RWO Volume (Block)

3. Next Steps

You have mastered Storage. Now, letโ€™s look at how to expose your applications to the world using Networking.

Kubernetes Glossary