0
0
Kubernetesdevops~20 mins

Volumes vs Persistent Volumes in Kubernetes - Practice Questions

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Kubernetes Storage Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
🧠 Conceptual
intermediate
1:30remaining
Understanding Kubernetes Volumes vs Persistent Volumes

Which statement correctly describes the difference between a Kubernetes Volume and a Persistent Volume?

AA Volume is tied to the lifecycle of a Pod, while a Persistent Volume exists independently and can be reused by multiple Pods.
BA Volume stores data permanently on the cloud provider, while a Persistent Volume stores data only temporarily.
CA Volume is a physical disk attached to the node, while a Persistent Volume is a virtual disk inside the Pod.
DA Volume requires manual provisioning, while a Persistent Volume is always created automatically by Kubernetes.
Attempts:
2 left
💡 Hint

Think about the lifecycle and reusability of storage in Kubernetes Pods.

💻 Command Output
intermediate
1:30remaining
Output of kubectl get pv command

What is the expected output when running kubectl get pv in a cluster with one Persistent Volume named pv-data that is Available and has a capacity of 10Gi?

A
NAME      CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS      CLAIM   STORAGECLASS   REASON   AGE
pv-data   10Gi       RWX            Delete           Bound       default/myclaim   fast   5d
B
NAME      CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS      CLAIM   STORAGECLASS   REASON   AGE
pv-data   10Gi       RWO            Retain           Available           standard              5d
C
NAME      CAPACITY   ACCESS MODES   RECLAIM POLICY   STATUS      CLAIM   STORAGECLASS   REASON   AGE
pv-data   5Gi        RWO            Retain           Available           standard              5d
DError from server (NotFound): persistentvolumes "pv-data" not found
Attempts:
2 left
💡 Hint

Check the status and capacity fields for an Available Persistent Volume.

Configuration
advanced
2:00remaining
Correct Persistent Volume YAML Configuration

Which YAML snippet correctly defines a Persistent Volume with 20Gi storage, ReadWriteOnce access mode, and a Retain reclaim policy?

A
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-storage
spec:
  capacity:
    storage: 20Gi
  accessModes:
    - ReadOnlyMany
  persistentVolumeReclaimPolicy: Retain
  hostPath:
    path: /mnt/data
B
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-storage
spec:
  capacity:
    storage: 20GB
  accessModes:
    - ReadWriteMany
  persistentVolumeReclaimPolicy: Delete
  hostPath:
    path: /mnt/data
C
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-storage
spec:
  capacity:
    storage: 20Gi
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Retain
  hostPath:
    path: /mnt/data
D
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-storage
spec:
  capacity:
    storage: 20Gi
  accessModes:
    - ReadWriteOnce
  persistentVolumeReclaimPolicy: Delete
  hostPath:
    path: /mnt/data
Attempts:
2 left
💡 Hint

Check storage size units, access modes, and reclaim policy spelling.

Troubleshoot
advanced
1:30remaining
Troubleshooting Pod Volume Mount Failure

A Pod fails to start with the error MountVolume.SetUp failed for volume "data" : persistentvolumeclaim "data-pvc" not found. What is the most likely cause?

AThe Kubernetes node does not have enough disk space.
BThe PersistentVolume is not bound to any PersistentVolumeClaim.
CThe Pod's container image is missing the volume mount path.
DThe PersistentVolumeClaim named 'data-pvc' does not exist in the Pod's namespace.
Attempts:
2 left
💡 Hint

Focus on the error message about the PersistentVolumeClaim.

🔀 Workflow
expert
2:30remaining
Order of Steps to Use Persistent Volumes in Kubernetes

Arrange the steps in the correct order to use a Persistent Volume in a Kubernetes Pod.

A1,2,4,3
B2,1,4,3
C1,4,2,3
D2,4,1,3
Attempts:
2 left
💡 Hint

Think about resource creation and binding before Pod deployment.