ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 81 - 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: 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

A.

Yes

Answers
A.

Yes

B.

No

Answers
B.

No

Suggested answer: B

Explanation:

= The strategy of creating a PersistentVolume with hostPath and a PersistentVolumeClaim to mount the /data directory on your laptop into a container will not work, because hostPath volumes are only suitable for single node testing or development. They are not portable across nodes and do not support dynamic provisioning. If you want to mount a local directory from your laptop into a Kubernetes pod, you need to use a different type of volume, such as NFS, hostPath CSI, or minikube. Alternatively, you can copy the files from your laptop to the container using kubectl cp command.Reference:

Volumes | Kubernetes

Configure a Pod to Use a PersistentVolume for Storage | Kubernetes

Mount a local directory to kubernetes pod - Stack Overflow

Kubernetes share a directory from your local system to kubernetes container - Stack Overflow

How to Mount a Host Directory Into a Docker Container

asked 08/11/2024
Lina Brown
40 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first