Which command mounts config map cm1 as volume myvol into /tmp/config in deployment myapp?

Prepare for the Red Hat Openshift Developer EX288 Exam. Study with comprehensive quizzes and flashcards. Each question includes hints and explanations to enhance your understanding. Ace your exam with confidence!

Multiple Choice

Which command mounts config map cm1 as volume myvol into /tmp/config in deployment myapp?

Explanation:
To mount a config map as a volume in a deployment, you add a volume of type configmap and create a matching volumeMount in the containers. The correct command specifies the deployment to modify as myapp, uses --add to introduce a new volume, sets the type to configmap, mounts it at /tmp/config, names the volume myvol, and points to the config map cm1. This updates the deployment’s pod template so the containers receive a volume backed by cm1 and mounted at /tmp/config. Using --remove would delete a volume, not mount one. Using -t secret would attach a secret instead of a config map. Targeting a different deployment would apply the changes to the wrong app.

To mount a config map as a volume in a deployment, you add a volume of type configmap and create a matching volumeMount in the containers. The correct command specifies the deployment to modify as myapp, uses --add to introduce a new volume, sets the type to configmap, mounts it at /tmp/config, names the volume myvol, and points to the config map cm1. This updates the deployment’s pod template so the containers receive a volume backed by cm1 and mounted at /tmp/config.

Using --remove would delete a volume, not mount one. Using -t secret would attach a secret instead of a config map. Targeting a different deployment would apply the changes to the wrong app.

Subscribe

Get the latest from Passetra

You can unsubscribe at any time. Read our privacy policy