Prepare and test your skills

Prepare and test your skills

Free sample question with answers and detailed explanation below. The Professional Cloud Developer practice bank has an additional 608 practice questions.Try 10 free realistic questions: instant score, no credit card, and no account required.
You are creating a Kubernetes Deployment manifest (apiVersion: apps/v1) to run a stateless payment-processing microservice on Google Kubernetes Engine (GKE). Your deployment must meet the following requirements:
Deployment manifest.How should you configure the Deployment manifest?
resources.limits under spec.template.spec.containers to reserve peak capacity upfront, and store both the application settings and the database password in a ConfigMap referenced via envFrom.This configuration sets only resources.limits on each container and places both regular application parameters and sensitive database passwords inside a single ConfigMap, injecting them into the container via envFrom.
resources.limits without resources.requests, Kubernetes automatically sets the container's requests equal to its limits. Reserving peak capacity upfront for every Pod wastes node CPU and memory during normal operation and limits how many Pods can be scheduled per node.ConfigMap is designed strictly for non-confidential configuration data and is stored and exposed in plaintext without the protections intended for sensitive data. Storing database passwords in a ConfigMap fails to properly isolate credentials.The workload required a strict Guaranteed QoS class with identical baseline and peak resource allocations, and all configuration values were strictly non-sensitive parameters that required no credential protection.
A common misconception is that resources.limits sets a maximum without affecting scheduling. In practice, Kubernetes defaults missing requests to limits, which directly impacts scheduler placement and cluster density.
resources.requests and resources.limits under spec.template.spec.containers, reference a ConfigMap for the non-sensitive settings, and inject the database password from a Kubernetes Secret using valueFrom.secretKeyRef or volumeMounts.In a Kubernetes Deployment manifest, container resource management and externalized configuration are handled inside spec.template.spec.containers. Combining resource requests and limits with ConfigMaps and Secrets separates runtime capacity guarantees, non-sensitive configuration, and sensitive credentials into distinct Kubernetes objects.
resources.requests tells the Kubernetes scheduler the minimum CPU and memory to reserve for each Pod, ensuring reliable placement on nodes with sufficient capacity. Setting resources.limits caps the maximum CPU and memory a container can consume, preventing a single Pod from starving neighboring workloads during traffic spikes.ConfigMap stores key-value pairs or configuration files such as feature flags and timeouts independently of the container image. Updating the ConfigMap and restarting Pods updates settings without an image rebuild.Secret stores sensitive data such as database passwords outside the container image and Deployment YAML. Referencing it via valueFrom.secretKeyRef (for environment variables) or volumeMounts (for mounted files) keeps credentials decoupled from application manifests.Unlike storing credentials in plain environment blocks or ConfigMaps, or omitting either requests or limits, this approach satisfies Kubernetes scheduling efficiency, node protection, and credential isolation simultaneously.
resources: {} empty in the Deployment so GKE assigns capacity dynamically, add a PodDisruptionBudget to cap node usage, and pass the settings and password through skaffold.yaml profiles.This approach leaves the container's resources block empty ({}), relies on a PodDisruptionBudget (PDB) for resource control, and attempts to use skaffold.yaml profiles to supply runtime application settings and database passwords.
resources: {} empty (unless a namespace LimitRange exists) assigns Pods the BestEffort QoS class, meaning Kubernetes reserves zero guaranteed CPU or memory and imposes no upper limit. On GKE Autopilot, missing requests are also populated with defaults rather than tailored to your microservice's needs.PodDisruptionBudget controls how many Pods must remain available during voluntary disruptions (such as node upgrades or drains). It does not measure or cap CPU and memory consumption.skaffold.yaml profiles select manifest variations or substitute container image references during CI/CD rendering; they do not provide secure runtime injection of decoupled credentials or dynamic ConfigMap management inside the cluster.resources are the first workloads terminated when a node experiences memory pressure.resources.requests and resources.limits manage compute capacity.kubectl apply, whereas ConfigMaps and Secrets manage runtime data inside Kubernetes.You were designing a CI/CD pipeline to select different Kubernetes manifest directories across staging and production targets while ensuring voluntary node drains keep a minimum number of replicas online.
resources.requests under spec.template.spec.containers so Pods can burst freely during traffic spikes, and add the application settings and database password directly as env key-value pairs in the Deployment.This configuration specifies resources.requests without resources.limits on the container and embeds both application settings and database passwords inline under spec.template.spec.containers[].env inside the Deployment manifest.
resources.limits, a container can consume all available CPU and memory on its host node during a traffic spike. This creates a noisy-neighbor problem that can trigger Out-Of-Memory (OOM) kills or CPU starvation for other Pods on the same node.env values couples configuration and sensitive credentials directly to the Deployment YAML. Anyone with read access to the Deployment manifest or version control repository can view the database password in plaintext.The requirement allowed unbounded bursting on dedicated single-tenant nodes and all env values were static, non-sensitive defaults that never needed to be decoupled from the Deployment specification.
Even when using Kubernetes env blocks, best practice is to populate values indirectly using valueFrom.configMapKeyRef and valueFrom.secretKeyRef rather than literal value fields for environment-specific or sensitive data.
Answer them yourself and get your score the moment you finish. No account needed.
Full access includes
Keep the momentum going with these hand-picked practice scenarios
Last updated Validated