Google Associate Cloud Engineer Practice Test 20

Question 190

A clustered database requires stable Pod identities and ordered deployment semantics. Which action is most appropriate?

  1. Create a managed instance group from an instance template
  2. Create a Kubernetes StatefulSet
  3. Create a Kubernetes Deployment
  4. Create a DaemonSet
  5. Create a Kubernetes Job

Explanation

Correct Answer

B:

StatefulSets provide stable identities and ordered operations for stateful applications. Storage persistence still requires suitable persistent volumes.

Incorrect Answers

A:

For the stated need to orchestrate a stateful cluster, this would instead maintain self-healing identical VM replicas; it supports the separate task to replace unhealthy stateless compute instances, not the required configuration.

C:

This approach can maintain stateless Pod replicas. The requirement is to orchestrate a stateful cluster, so it controls a different part of the workflow and leaves that result unaddressed.

D:

This setting would schedule one Pod on each selected node. That behavior does not establish the requested ability to orchestrate a stateful cluster; it addresses an adjacent concern instead.

E:

This choice is useful to run finite Kubernetes workloads. The stated task is to orchestrate a stateful cluster, which requires a different mechanism or permission scope.

Question 191

A service must run a log-forwarding Pod on every eligible Kubernetes node. Which solution should be used?

  1. Create a GKE Autopilot cluster
  2. Create a Kubernetes Deployment
  3. Create a DaemonSet
  4. Create a Kubernetes StatefulSet
  5. Create a Kubernetes Job

Explanation

Correct Answer

C:

DaemonSets arrange for Pods on matching nodes, often for agents. A standard Deployment maintains a replica count without guaranteeing every node is covered.

Incorrect Answers

A:

In a workflow for gke cluster operating modes, it can use managed GKE workload infrastructure; This question instead asks how to deploy node-wide agents; substituting the former action would leave that distinct technical requirement unmet.

B:

Administrators use it to maintain stateless Pod replicas, rather than to deploy node-wide agents. Applying it would change the wrong component of this deployment.

D:

This mechanism is intended to manage stable Pod identities. It does not implement the required action to deploy node-wide agents, even though both are relevant to the same general service.

E:

The result of this choice would be to run finite Kubernetes workloads. The requested outcome, to deploy node-wide agents, is handled at a different layer or through another operation.

Question 192

A batch data job should execute to completion rather than serve requests continuously. How should the team proceed?

  1. Create a Kubernetes Deployment
  2. Create a DaemonSet
  3. Create a Kubernetes Job
  4. Create a Kubernetes StatefulSet
  5. Create a GKE Standard cluster

Explanation

Correct Answer

C:

Jobs manage Pods for finite successful task execution. They differ from long-running Deployments and scheduled CronJobs.

Incorrect Answers

A:

It can maintain stateless Pod replicas; however, it does not provide the specific operation to execute a one-off batch job. The two controls serve different purposes.

B:

The tool can schedule one Pod on each selected node, but it cannot be substituted for the capability needed to execute a one-off batch job. Its operational effect is not equivalent.

D:

Using this action would manage stable Pod identities, not execute a one-off batch job. Its function is different from the specific change described in the scenario.

E:

The choice is aimed at a different purpose: to choose detailed cluster node control; Even if it can configure Kubernetes node infrastructure directly, that would not accomplish the stated requirement to execute a one-off batch job.

Question 193

Pods behind a deployment need a stable internal virtual IP inside the cluster. Which configuration best meets the requirement?

  1. Create a ClusterIP Kubernetes Service
  2. Configure a suitable GKE Ingress or Gateway resource with a controller
  3. Use a Service of type LoadBalancer
  4. Use a label selector on a Kubernetes Service pointing to the current Pods

Explanation

Correct Answer

A:

ClusterIP Services provide stable internal access to selected Pod endpoints. They do not automatically expose the workload to public internet clients.

Incorrect Answers

B:

Its purpose is to route HTTP requests across Kubernetes backends. That distinction matters: the scenario calls for an action to expose Pods only within Kubernetes, not this separate configuration task.

C:

While this can provision a cloud load balancer for a Service, the present task requires an action to expose Pods only within Kubernetes. This operation does not supply the behavior described in the requirements.

D:

Administrators use it to provide service discovery across changing Pods, rather than to expose Pods only within Kubernetes. Applying it would change the wrong component of this deployment.

Question 194

An application needs a Kubernetes Service that provisions a supported cloud load balancer. What should be configured?

  1. Use a label selector on a Kubernetes Service pointing to the current Pods
  2. Create a ClusterIP Kubernetes Service
  3. Configure a suitable GKE Ingress or Gateway resource with a controller
  4. Create a Kubernetes Deployment
  5. Use a Service of type LoadBalancer

Explanation

Correct Answer

E:

On supported GKE clusters, this service type integrates with cloud load-balancing infrastructure. The resulting exposure and address depend on service annotations and configuration.

Incorrect Answers

A:

This mechanism is intended to provide service discovery across changing Pods. It does not implement the required action to expose a service through provider load balancing, even though both are relevant to the same general service.

B:

It can provide cluster-internal service discovery; however, it does not provide the specific operation to expose a service through provider load balancing. The two controls serve different purposes.

C:

The tool can route HTTP requests across Kubernetes backends, but it cannot be substituted for the capability needed to expose a service through provider load balancing. Its operational effect is not equivalent.

D:

In a workflow for kubernetes workload types, it can maintain stateless Pod replicas; This question instead asks how to expose a service through provider load balancing; substituting the former action would leave that distinct technical requirement unmet.

Question 195

A Kubernetes Deployment in GKE has healthy Pods, but a Service shows no endpoints even though clients resolve its DNS name. Which THREE checks are relevant to the failure? (Choose THREE.)

  1. Inspect Pod readiness and any readiness probes that may exclude the Pods from service endpoints
  2. Compare the Service's selector labels with the labels currently assigned to the Pods
  3. Restart Cloud DNS public zones for the project's registered domain
  4. Change the Service type to LoadBalancer without checking selectors or Pods
  5. Confirm the Service and selected Pods are in the intended Kubernetes namespace

Explanation

Correct Answers

A:

A running Pod can be unready for traffic. Endpoint publication and routing respect readiness, so an unhealthy readiness state can explain missing usable endpoints.

B:

A Service selects Pods using its configured selectors. Label mismatches can leave the Service with no matching endpoints even while the Pods themselves are running.

E:

A Service's selector normally operates within its namespace. Healthy Pods with matching labels in another namespace are not automatically the Service's backends.

Incorrect Answers

C:

The problem is that the Kubernetes Service has no endpoints, not that external public DNS resolution failed. Public Cloud DNS zone changes would address the wrong layer.

D:

A LoadBalancer service changes exposure and forwarding, but it still needs correctly selected ready backend endpoints. It cannot fix a selector or readiness problem.

Question 196

A Kubernetes Service already has a stable ClusterIP, but its endpoints vanished after Pods changed their labels. Which solution should be used?

  1. Use a label selector on a Kubernetes Service pointing to the current Pods
  2. Create a Kubernetes Job
  3. Use a Service of type LoadBalancer
  4. Create a ClusterIP Kubernetes Service
  5. Configure a suitable GKE Ingress or Gateway resource with a controller

Explanation

Correct Answer

A:

The Service selects matching Pods and its endpoints update as Pods change. Directly hard-coding individual Pod IP addresses is brittle.

Incorrect Answers

B:

This alternative addresses kubernetes workload types by allowing a team to run finite Kubernetes workloads; The incident, however, requires the different action to avoid static Pod IP dependencies, so its central configuration remains unchanged.

C:

Select this when the goal is to provision a cloud load balancer for a Service. Here the decisive requirement is to avoid static Pod IP dependencies, and that outcome is not achieved by this action.

D:

Administrators use it to provide cluster-internal service discovery, rather than to avoid static Pod IP dependencies. Applying it would change the wrong component of this deployment.

E:

This mechanism is intended to route HTTP requests across Kubernetes backends. It does not implement the required action to avoid static Pod IP dependencies, even though both are relevant to the same general service.

Question 197

A Cloud Build pipeline builds an image and deploys it to a private Cloud Run service using a dedicated runtime identity. Which TWO access arrangements should be reviewed so build/deployment and runtime operations remain distinct? (Choose TWO.)

  1. Store a downloadable user-managed service account key inside the container image
  2. Give the runtime service account Project Owner so the pipeline can write image layers
  3. Allow the deployer to act as the chosen Cloud Run runtime service account
  4. Give the build identity the necessary Artifact Registry permissions to publish the image

Explanation

Correct Answers

C:

Assigning a runtime service identity requires the deploying principal to have the relevant service-account usage permission. This control is separate from the workload's data-access roles.

D:

Image publishing is an action of the build stage, normally performed under the pipeline's effective build service account. The runtime identity does not automatically provide build permissions.

Incorrect Answers

A:

Embedding a private credential in an image creates an unnecessary secret exposure risk. Cloud Build and Cloud Run can use managed service identities and short-lived credentials.

B:

The runtime service account is used by the running application, not necessarily by the image build process. Project Owner is excessive and does not establish proper stage separation.

Question 198

A developer wants to build and deploy Cloud Run from application source where supported. Which configuration best meets the requirement?

  1. Require Cloud Run Invoker IAM authorization rather than allowing public access
  2. Use the Cloud Run source deployment workflow
  3. Deploy a Cloud Run service referencing the container image
  4. Set environment variables on the service revision

Explanation

Correct Answer

B:

Source deployment builds the application into an image and deploys it through the supported build process. This avoids manually pushing a prebuilt image first.

Incorrect Answers

A:

Administrators use it to enforce authenticated Cloud Run invocation, rather than to streamline source-to-service deployment. Applying it would change the wrong component of this deployment.

C:

While this can deploy an HTTP service from a container image, the present task requires an action to streamline source-to-service deployment. This operation does not supply the behavior described in the requirements.

D:

The result of this choice would be to configure revision environment variables. The requested outcome, to streamline source-to-service deployment, is handled at a different layer or through another operation.

Question 199

A Cloud Run service needs environment-specific configuration without rebuilding the image. What should be configured?

  1. Configure an appropriate Eventarc Pub/Sub trigger for the Cloud Run service
  2. Deploy a Cloud Run service referencing the container image
  3. Set environment variables on the service revision
  4. Use the Cloud Run source deployment workflow
  5. Require Cloud Run Invoker IAM authorization rather than allowing public access

Explanation

Correct Answer

C:

Cloud Run revision configuration can provide runtime environment variables. Changes create a new revision; sensitive values may need Secret Manager integration.

Incorrect Answers

A:

This alternative addresses cloud run events and messaging by allowing a team to connect messaging events to a serverless destination; The incident, however, requires the different action to supply runtime app configuration, so its central configuration remains unchanged.

B:

It can deploy an HTTP service from a container image; however, it does not provide the specific operation to supply runtime app configuration. The two controls serve different purposes.

D:

This choice is useful to build and deploy Cloud Run from source. The stated task is to supply runtime app configuration, which requires a different mechanism or permission scope.

E:

The tool can enforce authenticated Cloud Run invocation, but it cannot be substituted for the capability needed to supply runtime app configuration. Its operational effect is not equivalent.

Question 200

A private API hosted in Cloud Run must require authenticated invocations. Which action is most appropriate?

  1. Set environment variables on the service revision
  2. Require Cloud Run Invoker IAM authorization rather than allowing public access
  3. Deploy a Cloud Run service referencing the container image
  4. Deploy a Cloud Run function with the corresponding event trigger
  5. Use the Cloud Run source deployment workflow

Explanation

Correct Answer

B:

Authenticated invocation relies on appropriate identities and tokens. Merely hiding the URL does not create a security boundary.

Incorrect Answers

A:

Its purpose is to configure revision environment variables. That distinction matters: the scenario calls for an action to protect a managed service from anonymous callers, not this separate configuration task.

C:

While this can deploy an HTTP service from a container image, the present task requires an action to protect a managed service from anonymous callers. This operation does not supply the behavior described in the requirements.

D:

The technical effect is to run an event-triggered function on object changes, not to protect a managed service from anonymous callers; That distinction matters here because the first operation serves respond to object creation events with function code, rather than the scenario's required result.

E:

This approach can build and deploy Cloud Run from source. The requirement is to protect a managed service from anonymous callers, so it controls a different part of the workflow and leaves that result unaddressed.

Associate Cloud Engineer Practice Tests