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: Add a volume to the pod that sets hostPath.path: /data, and then mount this volume into the pod’s containers as desired.
A . Yes
B . No
Answer: B
Explanation:
The solution will not work because a hostPath volume mounts a file or directory from the host node’s filesystem into the pod, not from the laptop1. The host node is the VM or machine where the pod is scheduled to run, not the machine where the kubectl commands are executed. Therefore, the /data directory on the laptop will not be accessible to the pod unless it is also present on the host node. A better solution would be to use a persistent volume that can be accessed from any node in the cluster, such as NFS, AWS EBS, or Azure Disk2.
Reference:
1: Volumes | Kubernetes
2: Persistent Volumes | Kubernetes
Latest DCA Dumps Valid Version with 55 Q&As
Latest And Valid Q&A | Instant Download | Once Fail, Full Refund