BLOG11a: Storage Reclaim Policy
BLOG 53: Storage Reclaim Policy
DEMO 1 — Understanding reclaimPolicy (Retain vs Delete vs Recycle)
reclaimPolicy (Retain vs Delete vs Recycle)Scenario
1. PV with Retain
RetainPV:
PVC:
Pod writes data:
Delete PVC:
Result?
Teaching point:
2. PV with Delete (Default for most cloud CSI drivers)
Delete (Default for most cloud CSI drivers)PV:
Result after deleting PVC:
Teaching point:
3. PV with Recycle (Deprecated but brilliant demo)
Recycle (Deprecated but brilliant demo)PV:
Result:
Teaching point:
DEMO 2 — Why emptyDir is Critical When Init Container Generates Data
emptyDir is Critical When Init Container Generates DataGoal of the demo
Demo Pod: init container writes → main container reads
Expected behavior
✔ Init container runs first
✔ Same file appears in main container’s path:
✔ Main container can read it and continue
✔ Delete pod → everything disappears
❗ 1. You must use a shared volume for init ↔ main
❗ 2. emptyDir is perfect because it:
❗ 3. emptyDir is essential for:
Hostpath
Short Answer
How you use HostPath
Needs PV?
Notes
1️⃣ HostPath WITHOUT PV (Pod-only mode)
What this means
✔ Good for:
❌ Not good for:
2️⃣ HostPath WITH PV + PVC (Recommended way)
PV:
PVC:
Pod:
Differences between Pod-only HostPath and PV-backed HostPath
Feature
Pod-only HostPath
PV-backed HostPath
When should HostPath use PV?
Best-Practice Summary
Use case
Recommended?
Last updated