Bird
0
0

Which of the following is the correct way to declare a Persistent Volume Claim (PVC) in a pod spec?

easy📝 Configuration Q12 of 15
Kubernetes - Persistent Storage
Which of the following is the correct way to declare a Persistent Volume Claim (PVC) in a pod spec?
A"volumes:\n - name: mypvc\n persistentVolumeClaim:\n claimName: myclaim"
B"volumes:\n - name: mypvc\n emptyDir: {}"
C"volumes:\n - name: mypvc\n hostPath:\n path: /data"
D"volumes:\n - name: mypvc\n configMap:\n name: myconfig"
Step-by-Step Solution
Solution:
  1. Step 1: Identify PVC syntax in pod spec

    Persistent Volume Claims are referenced under volumes with persistentVolumeClaim.claimName.
  2. Step 2: Check other volume types

    emptyDir is temporary storage, hostPath mounts host directory, configMap mounts config data, none are PVCs.
  3. Final Answer:

    volumes: - name: mypvc persistentVolumeClaim: claimName: myclaim -> Option A
  4. Quick Check:

    PVC uses persistentVolumeClaim.claimName [OK]
Quick Trick: PVCs use persistentVolumeClaim with claimName in volumes [OK]
Common Mistakes:
  • Using emptyDir or hostPath instead of persistentVolumeClaim
  • Missing claimName field
  • Confusing configMap with PVC

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Kubernetes Quizzes