Courseiva
mediumMultiple ChoiceObjective-mapped

Google ACE Practice Question: A DevOps engineer needs to deploy a new GKE Pod…

A DevOps engineer needs to deploy a new GKE Pod that mounts a ConfigMap named 'app-config' as environment variables. The ConfigMap already exists in the cluster. Which YAML snippet correctly references it?

⚠ Common exam trap

Google Cloud often tests the distinction between `configMapRef` and `secretRef` in `envFrom` blocks, and the trap here is that candidates confuse ConfigMaps with Secrets or incorrectly use volume syntax for environment variables.

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

envFrom: - configMapRef: name: app-config

The `envFrom` field with a `configMapRef` allows a Pod to load all key-value pairs from a ConfigMap as environment variables. This is the standard Kubernetes syntax for injecting ConfigMap data into a container's environment without specifying individual keys.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • envFrom: - configMapRef: name: app-config

    Why this is correct

    The `envFrom` field with a `configMapRef` entry creates environment variables for every key in the `app-config` ConfigMap, with the key name becoming the variable name. This is the correct, declarative way to inject an entire ConfigMap's data as environment variables without listing each key individually. Note that the variables are snapshotted at pod creation; later ConfigMap updates do not update the already-running container's environment.

  • volumes: - name: config / configMap: name: app-config

    Why it's wrong here

    This mounts the `app-config` ConfigMap as a volume, exposing its data as files (e.g., under a mount path) rather than as environment variables. In addition, the snippet omits the required `volumeMounts` section, so the volume is not attached to the container at all. The task calls for environment variables, so a volume mount is the wrong mechanism regardless.

  • env: - name: CONFIG / valueFrom: secretKeyRef: name: app-config

    Why it's wrong here

    Here the `env` entry uses `valueFrom` with `secretKeyRef`, which retrieves a specific key from a Kubernetes `Secret`. For a ConfigMap, the correct lookup would be `configMapKeyRef`, not `secretKeyRef`. This snippet would fail (or incorrectly read from a Secret) and does not load keys from the `app-config` ConfigMap as intended.

  • envFrom: - secretRef: name: app-config

    Why it's wrong here

    `secretRef` is a valid Kubernetes API field, but it can only reference a `Secret` object, not a `ConfigMap`. Pointing it at `app-config` would cause the Pod to fail to schedule (or image pull with an error) because the name resolves to a ConfigMap, not a Secret. Even if a Secret named `app-config` existed, the requirement is to load configuration from a ConfigMap, so this is the wrong resource type.

About these practice questions

This ACE question is part of Courseiva's 769-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

This ACE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the ACE exam.