Bird
0
0

You want to ensure data stored by your pod remains even if the pod is deleted and recreated. Which combination should you use?

hard📝 Best Practice Q15 of 15
Kubernetes - Persistent Storage
You want to ensure data stored by your pod remains even if the pod is deleted and recreated. Which combination should you use?
AUse a Volume with <code>emptyDir</code> in the pod spec.
BUse a Persistent Volume with a Persistent Volume Claim referenced in the pod spec.
CUse a hostPath volume pointing to a temporary directory.
DUse a ConfigMap volume to store data files.
Step-by-Step Solution
Solution:
  1. Step 1: Identify storage durability requirement

    Data must persist beyond pod lifecycle, so temporary volumes like emptyDir or hostPath to temp dirs won't work.
  2. Step 2: Choose correct storage type

    Persistent Volumes with PVCs provide durable storage independent of pods, ensuring data remains after pod deletion.
  3. Final Answer:

    Use a Persistent Volume with a Persistent Volume Claim referenced in the pod spec. -> Option B
  4. Quick Check:

    Persistent Volume + PVC = durable storage [OK]
Quick Trick: For durable data, always use Persistent Volume with PVC [OK]
Common Mistakes:
  • Using emptyDir for persistent data
  • Using hostPath to temporary directories
  • Confusing ConfigMap with storage for data

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes