Practice Qns GCP DevOps Set6
Practice Qns GCP DevOps Set6
Your organization stores all application logs from multiple Google Cloud projects in a central Cloud
Logging project. Your security team wants to enforce a rule that each project team can only view
their respective logs and only the operations team can view all the logs. You need to design a
solution that meets the security team s requirements while minimizing costs. What should you do?
• A. Grant each project team access to the project _Default view in the central logging
project. Grant togging viewer access to the operations team in the central logging project.
• B. Create Identity and Access Management (IAM) roles for each project team and restrict
access to the _Default log view in their individual Google Cloud project. Grant viewer
access to the operations team in the central logging project.
• C. Create log views for each project team and only show each project team their
application logs. Grant the operations team access to the _AllLogs view in the central
logging project. Most Voted
• D. Export logs to BigQuery tables for each project team. Grant project teams access to their
tables. Grant logs writer access to the operations team in the central logging project.
Your company uses Jenkins running on Google Cloud VM instances for CI/CD. You need to extend
the functionality to use infrastructure as code automation by using Terraform. You must ensure
that the Terraform Jenkins instance is authorized to create Google Cloud resources. You want to
follow Google-recommended practices. What should you do?
• A. Confirm that the Jenkins VM instance has an attached service account with the
appropriate Identity and Access Management (IAM) permissions. Most Voted
• B. Use the Terraform module so that Secret Manager can retrieve credentials.
• C. Create a dedicated service account for the Terraform instance. Download and copy the
secret key value to the GOOGLE_CREDENTIALS environment variable on the Jenkins
server.
• D. Add the gcloud auth application-default login command as a step in Jenkins before
running the Terraform commands.
You encounter a large number of outages in the production systems you support. You receive
alerts for all the outages, the alerts are due to unhealthy systems that are automatically restarted
within a minute. You want to set up a process that would prevent staff burnout while following Site
Reliability Engineering (SRE) practices. What should you do?
You are developing reusable infrastructure as code modules. Each module contains integration
tests that launch the module in a test project. You are using GitHub for source control. You need to
continuously test your feature branch and ensure that all code is tested before changes are
accepted. You need to implement a solution to automate the integration tests. What should you
do?
• A. Use a Jenkins server for CI/CD pipelines. Periodically run all tests in the feature branch.
• B. Ask the pull request reviewers to run the integration tests before approving the code.
• C. Use Cloud Build to run the tests. Trigger all tests to run after a pull request is merged.
• D. Use Cloud Build to run tests in a specific folder. Trigger Cloud Build for every GitHub pull
request. Most Voted
Your company runs services by using Google Kubernetes Engine (GKE). The GKE dusters in the
development environment run applications with verbose logging enabled. Developers view logs by
using the kubectl logs command and do not use Cloud Logging. Applications do not have a
uniform logging structure defined. You need to minimize the costs associated with application
logging while still collecting GKE operational logs. What should you do?
• A. Run the gcloud container clusters update --logging=SYSTEM command for the
development cluster.
• B. Run the gcloud container clusters update --logging=WORKLOAD command for the
development cluster.
• C. Run the gcloud logging sinks update _Default --disabled command in the project
associated with the development environment.
• D. Add the severity >= DEBUG resource.type = "k8s_container" exclusion filter to the
_Default logging sink in the project associated with the development environment. Most Voted
You have deployed a fleet of Compute Engine instances in Google Cloud. You need to ensure that
monitoring metrics and logs for the instances are visible in Cloud Logging and Cloud Monitoring by
your company's operations and cyber security teams. You need to grant the required roles for the
Compute Engine service account by using Identity and Access Management (IAM) while following
the principle of least privilege. What should you do?
• A. Deploy the prototype product in a test environment, run a load test, and share the results
with the product development team.
• B. When the initial product version passes the quality assurance phase and compliance
assessments, deploy the product to a staging environment. Share error logs and
performance metrics with the product development team.
• C. When the new product is used by at least one internal customer in production, share
error logs and monitoring metrics with the product development team.
• D. Review the design of the product with the product development team to provide
feedback early in the design phase. Most Voted
You are investigating issues in your production application that runs on Google Kubernetes Engine
(GKE). You determined that the source of the issue is a recently updated container image, although
the exact change in code was not identified. The deployment is currently pointing to the latest tag.
You need to update your cluster to run a version of the container that functions as intended. What
should you do?
• A. Create a new tag called stable that points to the previously working container, and
change the deployment to point to the new tag.
• B. Alter the deployment to point to the sha256 digest of the previously working
container. Most Voted
• C. Build a new container from a previous Git tag, and do a rolling update on the deployment
to the new container.
• D. Apply the latest tag to the previous container image, and do a rolling update on the
deployment.
You need to create a Cloud Monitoring SLO for a service that will be published soon. You want to
verify that requests to the service will be addressed in fewer than 300 ms at least 90% of the time
per calendar month. You need to identify the metric and evaluation method to use. What should
you do?
You have an application that runs on Cloud Run. You want to use live production traffic to test a
new version of the application, while you let the quality assurance team perform manual testing.
You want to limit the potential impact of any issues while testing the new version, and you must be
able to roll back to a previous version of the application if needed. How should you deploy the new
version? (Choose two.)
You need to introduce postmortems into your organization. You want to ensure that the
postmortem process is well received. What should you do? (Choose two.)
You are configuring your CI/CD pipeline natively on Google Cloud. You want builds in a pre-
production Google Kubernetes Engine (GKE) environment to be automatically load-tested before
being promoted to the production GKE environment. You need to ensure that only builds that have
passed this test are deployed to production. You want to follow Google-recommended practices.
How should you configure this pipeline with Binary Authorization?
• A. Create an attestation for the builds that pass the load test by requiring the lead quality
assurance engineer to sign the attestation by using their personal private key.
• B. Create an attestation for the builds that pass the load test by using a private key stored
in Cloud Key Management Service (Cloud KMS) with a service account JSON key stored as
a Kubernetes Secret.
• C. Create an attestation for the builds that pass the load test by using a private key stored
in Cloud Key Management Service (Cloud KMS) authenticated through Workload
Identity. Most Voted
• D. Create an attestation for the builds that pass the load test by requiring the lead quality
assurance engineer to sign the attestation by using a key stored in Cloud Key Management
Service (Cloud KMS).
You are deploying an application to Cloud Run. The application requires a password to start. Your
organization requires that all passwords are rotated every 24 hours, and your application must
have the latest password. You need to deploy the application with no downtime. What should you
do?
• A. Store the password in Secret Manager and send the secret to the application by using
environment variables.
• B. Store the password in Secret Manager and mount the secret as a volume within the
application. Most Voted
• C. Use Cloud Build to add your password into the application container at build time.
Ensure that Artifact Registry is secured from public access.
• D. Store the password directly in the code. Use Cloud Build to rebuild and deploy the
application each time the password changes.
Your company runs applications in Google Kubernetes Engine (GKE) that are deployed following a
GitOps methodology. Application developers frequently create cloud resources to support their
applications. You want to give developers the ability to manage infrastructure as code, while
ensuring that you follow Google-recommended practices. You need to ensure that infrastructure as
code reconciles periodically to avoid configuration drift. What should you do?
• A. Install and configure Config Connector in Google Kubernetes Engine (GKE). Most Voted
• B. Configure Cloud Build with a Terraform builder to execute terraform plan and terraform
apply commands.
• C. Create a Pod resource with a Terraform docker image to execute terraform plan and
terraform apply commands.
• D. Create a Job resource with a Terraform docker image to execute terraform plan and
terraform apply commands.
You are designing a system with three different environments: development, quality assurance
(QA), and production. Each environment will be deployed with Terraform and has a Google
Kubernetes Engine (GKE) cluster created so that application teams can deploy their applications.
Anthos Config Management will be used and templated to deploy infrastructure level resources in
each GKE cluster. All users (for example, infrastructure operators and application owners) will use
GitOps. How should you structure your source control repositories for both Infrastructure as Code
(IaC) and application code?
You are deploying a Cloud Build job that deploys Terraform code when a Git branch is updated.
While testing, you noticed that the job fails. You see the following error in the build logs:
Error: Failed to get existing workspaces: querying Cloud Storage failed: googleapi: Error 403
You need to resolve the issue by following Google-recommended practices. What should you do?
You are designing a deployment technique for your applications on Google Cloud. As part of your
deployment planning, you want to use live traffic to gather performance metrics for new versions
of your applications. You need to test against the full production load before your applications are
launched. What should you do?
Your Cloud Run application writes unstructured logs as text strings to Cloud Logging. You want to
convert the unstructured logs to JSON-based structured logs. What should you do?
• A. Modify the application to use Cloud Logging software development kit (SDK), and send
log entries with a jsonPayload field.
• B. Install a Fluent Bit sidecar container, and use a JSON parser.
• C. Install the log agent in the Cloud Run container image, and use the log agent to forward
logs to Cloud Logging.
• D. Configure the log agent to convert log text payload to JSON payload. Most Voted
You are leading a DevOps project for your organization. The DevOps team is responsible for
managing the service infrastructure and being on-call for incidents. The Software Development
team is responsible for writing, submitting, and reviewing code. Neither team has any published
SLOs. You want to design a new joint-ownership model for a service between the DevOps team and
the Software Development team. Which responsibilities should be assigned to each team in the
new joint-ownership model?
• A.
• B.
• C. Most Voted
• D.
You recently migrated an ecommerce application to Google Cloud. You now need to prepare the
application for the upcoming peak traffic season. You want to follow Google-recommended
practices. What should you do first to prepare for the busy season?
You are monitoring a service that uses n2-standard-2 Compute Engine instances that serve large
files. Users have reported that downloads are slow. Your Cloud Monitoring dashboard shows that
your VMs are running at peak network throughput. You want to improve the network throughput
performance. What should you do?
Your organization is starting to containerize with Google Cloud. You need a fully managed storage
solution for container images and Helm charts. You need to identify a storage solution that has
native integration into existing Google Cloud services, including Google Kubernetes Engine (GKE),
Cloud Run, VPC Service Controls, and Identity and Access Management (IAM). What should you
do?
• A. Use Docker to configure a Cloud Storage driver pointed at the bucket owned by your
organization.
• B. Configure an open source container registry server to run in GKE with a restrictive role-
based access control (RBAC) configuration.
• C. Configure Artifact Registry as an OCI-based container registry for both Helm charts and
container images. Most Voted
• D. Configure Container Registry as an OCI-based container registry for container images.