0
0
Kubernetesdevops~10 mins

PersistentVolume (PV) definition in Kubernetes - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to define the API version for a PersistentVolume.

Kubernetes
apiVersion: [1]
kind: PersistentVolume
metadata:
  name: pv-example
Drag options to blanks, or click blank then click option'
Av1
Bv1beta1
Capps/v1
Dstorage.k8s.io/v1
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'apps/v1' which is for deployments and other workload resources.
Using 'storage.k8s.io/v1' which is for StorageClass and CSI drivers.
2fill in blank
medium

Complete the code to specify the PersistentVolume capacity.

Kubernetes
spec:
  capacity:
    storage: [1]
Drag options to blanks, or click blank then click option'
A10MB
B10GB
C10Gi
D10
Attempts:
3 left
💡 Hint
Common Mistakes
Using '10GB' which is not the correct unit in Kubernetes specs.
Omitting the unit, which causes errors.
3fill in blank
hard

Fix the error in the PersistentVolume access mode specification.

Kubernetes
spec:
  accessModes:
    - [1]
Drag options to blanks, or click blank then click option'
AReadWriteOnce
BReadWriteMany
CReadOnlyOnce
DWriteOnlyOnce
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid access modes like 'WriteOnlyOnce'.
Confusing 'ReadOnlyOnce' with 'ReadOnlyMany'.
4fill in blank
hard

Fill both blanks to define the PersistentVolume host path and reclaim policy.

Kubernetes
spec:
  hostPath:
    path: [1]
  persistentVolumeReclaimPolicy: [2]
Drag options to blanks, or click blank then click option'
A/mnt/data
BRetain
CDelete
D/var/lib/data
Attempts:
3 left
💡 Hint
Common Mistakes
Using relative paths for hostPath.
Using an invalid reclaim policy string.
5fill in blank
hard

Fill all three blanks to complete the PersistentVolume spec with storage class, volume mode, and capacity.

Kubernetes
spec:
  storageClassName: [1]
  volumeMode: [2]
  capacity:
    storage: [3]
Drag options to blanks, or click blank then click option'
Afast-storage
BBlock
C20Gi
DFilesystem
Attempts:
3 left
💡 Hint
Common Mistakes
Using invalid volume modes.
Omitting units in capacity.