0
0
Kubernetesdevops~10 mins

Why persistent storage matters in Kubernetes - Test Your Understanding

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

Complete the code to create a PersistentVolumeClaim in Kubernetes.

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'
AReadWriteOnce
BReadOnlyMany
CWriteOnce
DReadWriteMany
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing ReadOnlyMany when write access is needed.
Using WriteOnce which is not a valid Kubernetes access mode.
2fill in blank
medium

Complete the code to mount the PersistentVolumeClaim in a Pod.

Kubernetes
apiVersion: v1
kind: Pod
metadata:
  name: my-pod
spec:
  containers:
  - name: app
    image: nginx
    volumeMounts:
    - mountPath: /usr/share/nginx/html
      name: [1]
  volumes:
  - name: my-volume
    persistentVolumeClaim:
      claimName: my-pvc
Drag options to blanks, or click blank then click option'
Amy-pvc
Bhtml-volume
Cmy-volume
Dnginx-volume
Attempts:
3 left
💡 Hint
Common Mistakes
Using the PersistentVolumeClaim name instead of the volume name.
Mismatching names causing the volume not to mount.
3fill in blank
hard

Fix the error in the PersistentVolumeClaim spec to request 5Gi of storage.

Kubernetes
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: data-pvc
spec:
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: [1]
Drag options to blanks, or click blank then click option'
A5Gi
B5GB
C5000Mi
D5G
Attempts:
3 left
💡 Hint
Common Mistakes
Using GB instead of Gi causing validation errors.
Using incorrect units like G or MB.
4fill in blank
hard

Fill both blanks to create a PersistentVolumeClaim that requests 10Gi storage with ReadWriteMany access.

Kubernetes
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: shared-pvc
spec:
  accessModes:
    - [1]
  resources:
    requests:
      storage: [2]
Drag options to blanks, or click blank then click option'
AReadWriteMany
BReadWriteOnce
C10Gi
D5Gi
Attempts:
3 left
💡 Hint
Common Mistakes
Using ReadWriteOnce instead of ReadWriteMany for shared volumes.
Requesting 5Gi instead of 10Gi storage.
5fill in blank
hard

Fill all three blanks to define a Pod that mounts a PersistentVolumeClaim named 'data-pvc' at '/data'.

Kubernetes
apiVersion: v1
kind: Pod
metadata:
  name: data-pod
spec:
  containers:
  - name: app
    image: busybox
    command: ['sleep', '3600']
    volumeMounts:
    - name: [1]
      mountPath: [2]
  volumes:
  - name: [3]
    persistentVolumeClaim:
      claimName: data-pvc
Drag options to blanks, or click blank then click option'
Adata-volume
B/data
D/var/data
Attempts:
3 left
💡 Hint
Common Mistakes
Using different names for volume in mounts and volumes sections.
Setting mountPath to a wrong directory.