nerdexam
Docker

DCA · Question #125

During development of an application meant to be orchestrated by Kubernetes, you want to mount the /data directory on your laptop into a container. Will this strategy successfully accomplish this? Sol

The correct answer is A. Yes. In a single-node Kubernetes development setup, a PersistentVolume with hostPath and a corresponding PersistentVolumeClaim can successfully mount a local directory from the laptop (acting as the node) into a container.

Submitted by emma.c· Apr 18, 2026Storage and Volumes

Question

During development of an application meant to be orchestrated by Kubernetes, you want to mount the /data directory on your laptop into a container. Will this strategy successfully accomplish this? Solution: Create a PersistentVolume with storageciass: "" and hostPath: /data, and a persistentVolumeClaim requesting this PV. Then use that PVC to populate a volume in a pod

Options

  • AYes
  • BNo

How the community answered

(34 responses)
  • A
    85% (29)
  • B
    15% (5)

Why each option

In a single-node Kubernetes development setup, a `PersistentVolume` with `hostPath` and a corresponding `PersistentVolumeClaim` can successfully mount a local directory from the laptop (acting as the node) into a container.

AYesCorrect

For a single-node development environment where the laptop acts as the Kubernetes node, configuring a `PersistentVolume` with `hostPath: /data` and binding it via a `PersistentVolumeClaim` allows the specified directory on the host (laptop) to be mounted into a Pod's containers.

BNo

This is a valid and commonly used Kubernetes pattern for mounting directories from the host filesystem into pods, especially in local development or single-node cluster scenarios.

Concept tested: Kubernetes PersistentVolume hostPath for local development

Source: https://kubernetes.io/docs/concepts/storage/persistent-volumes/#hostpath

Topics

#Kubernetes Volumes#PersistentVolume#PersistentVolumeClaim#hostPath

Community Discussion

No community discussion yet for this question.

Full DCA Practice