Question 36
Domain 4: StorageWhich kubectl manifest creates a PersistentVolume named my-vol with 10Gi capacity, ReadWriteOnce access mode, using a hostPath at /test/path?
Correct answer: A
Explanation
A PersistentVolume manifest is identified by `kind: PersistentVolume`, and the name comes from `metadata: name: my-vol`. The spec matches the requested settings because it sets `capacity: storage: 10Gi`, `accessModes: - ReadWriteOnce`, and uses `hostPath: path: /test/path`.
Why each option is right or wrong
A. apiVersion: v1 kind: PersistentVolume metadata: name: my-vol spec: capacity: storage: 10Gi accessModes: - ReadWriteOnce hostPath: path: /test/path
Under the Kubernetes API for persistent storage, a PersistentVolume is declared with `apiVersion: v1` and `kind: PersistentVolume`, and the object name is set in `metadata.name` per the core object metadata schema. The spec here matches the required PV fields exactly: `spec.capacity.storage` is `10Gi`, `spec.accessModes` includes `ReadWriteOnce`, and `spec.hostPath.path` points to `/test/path`, which is the host filesystem path used by the volume source.
B. apiVersion: v1 kind: PersistentVolume metadata: name: my-vol spec: capacity: storage: 10Gi accessModes: - ReadOnlyMany hostPath: path: /test/path
C. apiVersion: v1 kind: PersistentVolumeClaim metadata: name: my-vol spec: resources: requests: storage: 10Gi accessModes: - ReadWriteOnce
D. apiVersion: v1 kind: PersistentVolume metadata: name: my-vol spec: capacity: storage: 10Gi accessModes: - ReadWriteMany nfs: path: /test/path