ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 49 - DCA discussion

Report
Export

You want to provide a configuration file to a container at runtime. Does this set of Kubernetes tools and steps accomplish this?

Solution: Turn the configuration file into a configMap object, use it to populate a volume associated with the pod, and mount that file from the volume to the appropriate container and path.

A.

Yes

Answers
A.

Yes

B.

No

Answers
B.

No

Suggested answer: B

Explanation:

= Mounting the configuration file directly into the appropriate pod and container using the .spec.containers.configMounts key is not a valid way to provide a configuration file to a container at runtime.The .spec.containers.configMounts key does not exist in the Kubernetes API1.The correct way to provide a configuration file to a container at runtime is to use a ConfigMap2. A ConfigMap is a Kubernetes object that stores configuration data as key-value pairs. You can create a ConfigMap from a file, and then mount the ConfigMap as a volume into the pod and container.The configuration file will be available as a file in the specified mount path3.Alternatively, you can also use environment variables to pass configuration data to a container from a ConfigMap4.Reference:

PodSpec v1 core

Configure a Pod to Use a ConfigMap

Populate a Volume with data stored in a ConfigMap

Define Container Environment Variables Using ConfigMap Data

asked 08/11/2024
Muhammad Imran
41 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first