Google Professional Cloud DevOps Engineer exam dumps

Google Professional Cloud DevOps Engineer practice question 112 of 268

Professional Cloud DevOps Engineer. Associate level, Google Cloud. Free question with the correct answer and a full explanation.

Google Professional Cloud DevOps Engineer Question 112

Select 3Google Cloud Platform

Your team is deploying a new version of a critical web application hosted on Google Kubernetes Engine (GKE). To ensure a smooth rollout, you need to safely drain traffic from the existing pods while redirecting traffic to the newly deployed pods. Which steps should you take to achieve this without causing downtime?

  1. A

    Set the maxSurge and maxUnavailable parameters in the deployment's rollingUpdate strategy to control the replacement of pods.

  2. B

    Use a preStop hook in the pod's lifecycle to handle cleanup tasks before the pod is terminated.

  3. C

    Manually delete old pods to ensure new pods serve traffic immediately.

  4. D

    Update the Service's selector to point to the new pods and leave the old pods running.

  5. E

    Configure a readiness probe in the new pod specification to ensure traffic is redirected only after the new pods are ready.

Show answer and explanation

Correct answers: A, B, E

Explanation

To safely drain traffic and redirect it to new pods during a deployment, you should leverage Kubernetes-native features such as rolling updates (maxSurge and maxUnavailable), preStop hooks for graceful termination, and readiness probes to ensure new pods are ready before serving traffic. These steps ensure seamless traffic redirection without causing downtime.

  • A. Correct.

    Setting maxSurge and maxUnavailable allows you to control how many pods are created or taken down during a rolling update, ensuring a controlled traffic shift.

  • B. Correct.

    Using a preStop hook ensures that any necessary cleanup or graceful shutdown operations occur before the pod is terminated, helping prevent service disruptions.

  • C. Incorrect.

    Manually deleting old pods can cause abrupt disruptions in traffic and risks creating downtime, as it bypasses the rolling update mechanisms.

  • D. Incorrect.

    Updating the Service's selector to point only to the new pods may leave existing traffic stranded if the old pods are still receiving requests. This is not a recommended method for draining traffic.

  • E. Correct.

    A readiness probe ensures that new pods do not receive traffic until they are fully initialized and ready to serve requests, preventing disruptions during the transition.

Timed practice exam

Take a Google Professional Cloud DevOps Engineer practice test under exam conditions

60 questions in 120 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam