ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











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

A.

Yes

Answers
A.

Yes

B.

No

Answers
B.

No

Suggested answer: B

Explanation:

The strategy willnotsuccessfully accomplish mounting the /data directory on your laptop into a container. Thecontainers. Mounts. hostBinding: /datais not a valid syntax for specifying a bind mount in a Kubernetes container specification. According to the Kubernetes documentation), the correct way to mount a host directory into a container is to use ahostPathvolume, which takes apathparameter that specifies the location on the host. For example, to mount the /data directory on your laptop into a container at /var/data, you can use the following YAML snippet:

spec:

containers:

- name: my-container

image: my-image

volumeMounts:

- name: data-volume

mountPath: /var/data

volumes:

- name: data-volume

hostPath:

path: /data

asked 08/11/2024
Jay Fletcher
49 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first