ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 80 - DCA discussion

Report
Export

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

Answers
A.

Yes

B.

No

Answers
B.

No

Suggested 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

asked 08/11/2024
Alice Smith
39 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first