0
0
Kubernetesdevops~10 mins

Volumes vs Persistent Volumes in Kubernetes - Interactive Practice

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

Complete the code to define a simple emptyDir volume in a pod spec.

Kubernetes
volumes:
  - name: cache-volume
    [1]: {}
Drag options to blanks, or click blank then click option'
AemptyDir
BconfigMap
CpersistentVolumeClaim
DhostPath
Attempts:
3 left
💡 Hint
Common Mistakes
Using persistentVolumeClaim instead of emptyDir for temporary storage.
2fill in blank
medium

Complete the code to reference a PersistentVolumeClaim in a pod volume.

Kubernetes
volumes:
  - name: data-storage
    [1]:
      claimName: my-pvc
Drag options to blanks, or click blank then click option'
AhostPath
BemptyDir
CpersistentVolumeClaim
Dsecret
Attempts:
3 left
💡 Hint
Common Mistakes
Using emptyDir instead of persistentVolumeClaim for persistent storage.
3fill in blank
hard

Fix the error in the PersistentVolumeClaim YAML by completing the missing access mode.

Kubernetes
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: my-pvc
spec:
  accessModes:
    - [1]
  resources:
    requests:
      storage: 1Gi
Drag options to blanks, or click blank then click option'
AReadWriteMany
BReadWriteOnce
CWriteOnce
DReadOnlyMany
Attempts:
3 left
💡 Hint
Common Mistakes
Using WriteOnce which is not a valid access mode.
4fill in blank
hard

Fill both blanks to create a pod volume that uses a PersistentVolumeClaim named 'data-pvc' and mounts it at '/data'.

Kubernetes
volumes:
  - name: data-volume
    [1]:
      claimName: data-pvc
containers:
  - name: app
    volumeMounts:
      - name: data-volume
        mountPath: [2]
Drag options to blanks, or click blank then click option'
ApersistentVolumeClaim
B/var/log
C/data
DemptyDir
Attempts:
3 left
💡 Hint
Common Mistakes
Using emptyDir instead of persistentVolumeClaim for persistent storage.
Mounting at wrong path like /var/log.
5fill in blank
hard

Fill all three blanks to define a PersistentVolume with 5Gi storage, access mode ReadWriteOnce, and hostPath '/mnt/data'.

Kubernetes
apiVersion: v1
kind: PersistentVolume
metadata:
  name: pv-data
spec:
  capacity:
    storage: [1]
  accessModes:
    - [2]
  hostPath:
    path: [3]
Drag options to blanks, or click blank then click option'
A10Gi
BReadWriteOnce
C/mnt/data
D5Gi
Attempts:
3 left
💡 Hint
Common Mistakes
Using 10Gi instead of 5Gi for storage.
Wrong access mode or hostPath.