Summer Special - Limited Time 65% Discount Offer - Ends in 0d 00h 00m 00s - Coupon code: top65certs

Cloud Developer Professional-Cloud-Developer Google Study Notes

Google Certified Professional - Cloud Developer Questions and Answers

Question 25

You have an application running in a production Google Kubernetes Engine (GKE) cluster. You use Cloud Deploy to automatically deploy your application to your production GKE cluster. As part of your development process: you are planning to make frequent changes to the applications source code and need to select the tools to test the changes before pushing them to your remote source code repository. Your toolset must meet the following requirements:

• Test frequent local changes automatically.

• Local deployment emulates production deployment.

Which tools should you use to test building and running a container on your laptop using minimal resources'?

Options:

A.

Terraform and kubeadm

B.

Docker Compose and dockerd

C.

Minikube and Skaffold

D.

kaniko and Tekton

Question 26

You are configuring a continuous integration pipeline using Cloud Build to automate the deployment of new container images to Google Kubernetes Engine (GKE). The pipeline builds the application from its source code, runs unit and integration tests in separate steps, and pushes the container to Container Registry. The application runs on a Python web server.

The Dockerfile is as follows:

FROM python:3.7-alpine -

COPY . /app -

WORKDIR /app -

RUN pip install -r requirements.txt

CMD [ "gunicorn", "-w 4", "main:app" ]

You notice that Cloud Build runs are taking longer than expected to complete. You want to decrease the build time. What should you do? (Choose two.)

Options:

A.

Select a virtual machine (VM) size with higher CPU for Cloud Build runs.

B.

Deploy a Container Registry on a Compute Engine VM in a VPC, and use it to store the final images.

C.

Cache the Docker image for subsequent builds using the -- cache-from argument in your build config file.

D.

Change the base image in the Dockerfile to ubuntu:latest, and install Python 3.7 using a package manager utility.

E.

Store application source code on Cloud Storage, and configure the pipeline to use gsutil to download the source code.

Question 27

You have recently instrumented a new application with OpenTelemetry, and you want to check the latency of your application requests in Trace. You want to ensure that a specific request is always traced. What should you do?

Options:

A.

Wait 10 minutes, then verify that Trace captures those types of requests automatically.

B.

Write a custom script that sends this type of request repeatedly from your dev project.

C.

Use the Trace API to apply custom attributes to the trace.

D.

Add the X-Cloud-Trace-Context header to the request with the appropriate parameters.

Question 28

Your company’s corporate policy states that there must be a copyright comment at the very beginning of all source files. You want to write a custom step in Cloud Build that is triggered by each source commit. You need the trigger to validate that the source contains a copyright and add one for subsequent steps if not there. What should you do?

Options:

A.

Build a new Docker container that examines the files in /workspace and then checks and adds a copyright for each source file. Changed files are explicitly committed back to the source repository.

B.

Build a new Docker container that examines the files in /workspace and then checks and adds a copyright for each source file. Changed files do not need to be committed back to the source repository.

C.

Build a new Docker container that examines the files in a Cloud Storage bucket and then checks and adds a copyright for each source file. Changed files are written back to the Cloud Storage bucket.

D.

Build a new Docker container that examines the files in a Cloud Storage bucket and then checks and adds a copyright for each source file. Changed files are explicitly committed back to the source repository.