Question 16
Domain 4: StorageWhich Kubernetes storage configuration best satisfies an app that needs 5Gi of persistent storage with multi-pod access, uses the `fast-ssd` StorageClass, and mounts the volume at `/data` in an existing `db-app` Deployment?
Correct answer: A
Explanation
A PersistentVolumeClaim is the Kubernetes object that requests storage, and the app needs "5Gi of persistent storage" with the `fast-ssd` StorageClass, so the claim must specify `storageClassName: fast-ssd` and 5Gi capacity. Multi-pod access requires `ReadWriteMany`, and mounting the PVC at "/data" in the existing `db-app` Deployment attaches that storage to the workload in the `databases` namespace.
Why each option is right or wrong
A. Create a 5Gi PersistentVolume and PersistentVolumeClaim with access mode `ReadWriteMany`, storageClassName `fast-ssd`, then add the PVC as a volume mounted at `/data` in the `db-app` Deployment in the `databases` namespace.
Kubernetes persistent storage is provisioned through a PersistentVolume/PersistentVolumeClaim pair, and the claim must request the exact 5Gi capacity while binding to the specified `fast-ssd` class via `storageClassName: fast-ssd` (Kubernetes PersistentVolumes and PersistentVolumeClaims API). Because the workload needs the same volume accessible from multiple pods, the access mode must be `ReadWriteMany`; `ReadWriteOnce` would not satisfy concurrent multi-pod mounting. Adding that PVC to the existing `db-app` Deployment and mounting it at `/data` in the `databases` namespace attaches the storage to the running workload in the correct namespace.
B. Create a 5Gi PersistentVolumeClaim with access mode `ReadWriteOnce`, storageClassName `fast-ssd`, then mount it at `/data` in the Deployment.
C. Create a 5Gi `emptyDir` volume and mount it at `/data` in the Deployment because it supports sharing across multiple pods.
D. Create a `ConfigMap` named `fast-ssd` and mount it at `/data` so the data persists and can be shared by multiple pods.