BlackFriday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Docker Exam DCA Topic 3 Question 79 Discussion

Actual exam question for Docker's DCA exam
Question #: 79
Topic #: 3
[All DCA Questions]

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. Set containers. Mounts. hostBinding: /data in the container's specification.

Show Suggested Answer Hide Answer
Suggested Answer: B

This strategy does not successfully mount the /data directory on your laptop into a container. Setting containers.mounts.hostBinding to /data in the container's specification is not a valid way to mount a host directory into a container in Kubernetes. Kubernetes does not support mounting arbitrary host directories into containers, as this would break the portability and isolation of pods across different nodes. To mount a host directory into a container in Kubernetes, you need to use one of the following methods:

Use hostPath volume, which allows you to mount a file or directory from the host node's filesystem into your pod.

Use local volume, which allows you to mount local storage devices such as disks or partitions into your pod.

Use persistentVolume and persistentVolumeClaim with hostPath or local volume as storage class, which allows you to abstract the details of how storage is provided from how it is consumed. Reference: https://kubernetes.io/docs/concepts/storage/volumes/#hostpath, https://kubernetes.io/docs/concepts/storage/volumes/#local, https://kubernetes.io/docs/concepts/storage/persistent-volumes/


Contribute your Thoughts:

Currently there are no comments in this discussion, be the first to comment!


Save Cancel