0
0
Kubernetesdevops~20 mins

PersistentVolumeClaim (PVC) definition in Kubernetes - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
PVC Mastery Badge
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding PVC Access Modes

Which access mode allows multiple pods to read and write to the same PersistentVolume simultaneously?

AWriteOnceMany (WOM)
BReadOnlyMany (ROX)
CReadWriteMany (RWX)
DReadWriteOnce (RWO)
Attempts:
2 left
💡 Hint

Think about which mode supports multiple writers at the same time.

💻 Command Output
intermediate
1:30remaining
PVC Status After Creation

You create a PersistentVolumeClaim with the following YAML snippet:

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-pvc
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 5Gi

What will be the status.phase of this PVC immediately after creation if a matching PersistentVolume is available?

ABound
BAvailable
CPending
DLost
Attempts:
2 left
💡 Hint

Consider what happens when a PVC successfully binds to a PV.

Configuration
advanced
2:00remaining
Correct PVC YAML for Storage Class and Size

Which YAML snippet correctly defines a PersistentVolumeClaim requesting 10Gi storage with the storage class 'fast-storage'?

A
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: fast-pvc
spec:
  accessMode: ReadWriteOnce
  storageClass: fast-storage
  resources:
    requests:
      storage: 10GB
B
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: fast-pvc
spec:
  storageClassName: fast-storage
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi
C
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: fast-pvc
spec:
  storageClassName: fast-storage
  accessModes:
    - ReadWriteMany
  resources:
    requests:
      storage: 10Gi
D
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: fast-pvc
spec:
  storageClassName: fast-storage
  accessModes:
    - ReadWriteOnce
  resources:
    limits:
      storage: 10Gi
Attempts:
2 left
💡 Hint

Check the correct keys for storage class, access modes, and resource requests.

Troubleshoot
advanced
1:30remaining
PVC Stuck in Pending State

You created a PVC but it remains in the 'Pending' state for a long time. Which of the following is the most likely cause?

ANo PersistentVolume matches the PVC's requested size or access mode
BThe PVC YAML is missing the metadata.name field
CThe pod using the PVC is not running
DThe PVC has already been deleted
Attempts:
2 left
💡 Hint

Think about what must exist for a PVC to bind successfully.

🔀 Workflow
expert
2:30remaining
Order of Steps to Use a PVC in a Pod

Arrange the steps in the correct order to use a PersistentVolumeClaim in a Pod.

A2,3,1,4
B2,1,3,4
C1,3,2,4
D1,2,3,4
Attempts:
2 left
💡 Hint

Think about what must exist before a PVC can bind and a Pod can use it.