Recall & Review
beginner
What is a PersistentVolume (PV) in Kubernetes?
A PersistentVolume (PV) is a piece of storage in the cluster that has been provisioned by an administrator or dynamically. It is a resource in the cluster just like a node and is used to store data persistently beyond the lifecycle of a pod.
Click to reveal answer
intermediate
Which key fields are required in a PersistentVolume YAML definition?
The key fields include: apiVersion, kind (PersistentVolume), metadata (name), spec (capacity, accessModes, persistentVolumeReclaimPolicy, storageClassName, and the actual storage details like hostPath, nfs, etc.).
Click to reveal answer
beginner
What does the 'accessModes' field specify in a PersistentVolume?
The 'accessModes' field defines how the volume can be mounted by pods. Common modes are ReadWriteOnce (mounted by a single node), ReadOnlyMany (mounted read-only by many nodes), and ReadWriteMany (mounted read-write by many nodes).
Click to reveal answer
intermediate
What is the purpose of 'persistentVolumeReclaimPolicy' in a PV?
It tells Kubernetes what to do with the volume after the claim is released. Common policies are Retain (keep data), Recycle (basic scrub), and Delete (remove volume).
Click to reveal answer
beginner
Show a simple example of a PersistentVolume definition using hostPath.
apiVersion: v1
kind: PersistentVolume
metadata:
name: example-pv
spec:
capacity:
storage: 1Gi
accessModes:
- ReadWriteOnce
persistentVolumeReclaimPolicy: Retain
hostPath:
path: /mnt/data
Click to reveal answer
What does a PersistentVolume in Kubernetes represent?
✗ Incorrect
A PersistentVolume is a storage resource in the Kubernetes cluster used to persist data.
Which field in a PV definition specifies how the volume can be accessed by pods?
✗ Incorrect
The 'accessModes' field defines how pods can mount the volume.
What does the 'persistentVolumeReclaimPolicy' control?
✗ Incorrect
It controls what happens to the volume after the claim is released.
Which of these is NOT a valid access mode for a PersistentVolume?
✗ Incorrect
'WriteOnlyOnce' is not a valid access mode in Kubernetes.
In a hostPath PersistentVolume, what does the 'path' specify?
✗ Incorrect
The 'path' specifies the directory on the node's filesystem to use for storage.
Describe the main components and fields of a PersistentVolume definition in Kubernetes.
Think about the YAML structure and what each part means.
You got /8 concepts.
Explain the difference between the access modes ReadWriteOnce, ReadOnlyMany, and ReadWriteMany in PersistentVolumes.
Consider how many nodes can use the volume and in what mode.
You got /3 concepts.