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 Enterprise (GKE Enterprise) cluster created so that application teams can deploy their applications. Config Sync will be used and templated to deploy infrastructure-level resources in each GKE Enterprise 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?
Correct Answer: A
Comprehensive and Detailed Explanation: To follow GitOps best practices and Google Cloud's recommended repository structure for Terraform (IaC), Config Sync, and application code, we should use a shared repository for Terraform and Config Sync while keeping application repositories separate. Cloud Infrastructure (Terraform) repository is shared # This allows infrastructure teams to manage all environments in a single repository with different directories per environment (dev, QA, production). This is the standard approach to structuring Terraform repositories. GKE Enterprise Infrastructure (Config Sync) repository is shared # Using Kustomize overlays per environment (instead of separate repositories) aligns with Config Sync's best practices and makes managing configurations easier. Application repositories are separated, using different branches for features # This allows application teams to follow the Git branching model (feature branches, main branch, release branches, etc.) without affecting infrastructure. #Official Reference: Config Sync Best Practices Terraform Structure Best Practices GitOps Best Practices
Question 97
You have a pool of application servers running on Compute Engine. You need to provide a secure solution that requires the least amount of configuration and allows developers to easily access application logs for troubleshooting. How would you implement the solution on GCP?
Correct Answer: B
Question 98
You use Cloud Build to build your application. You want to reduce the build time while minimizing cost and development effort. What should you do?
Correct Answer: C
Question 99
Your company processes IOT data at scale by using Pub/Sub, App Engine standard environment, and an application written in GO. You noticed that the performance inconsistently degrades at peak load. You could not reproduce this issue on your workstation. You need to continuously monitor the application in production to identify slow paths in the code. You want to minimize performance impact and management overhead. What should you do?
Correct Answer: C
The correct answer is C. Configure Cloud Profiler, and initialize the cloud.google.com/go/profiler library in the application. According to the Google Cloud documentation, Cloud Profiler is a statistical, low-overhead profiler that continuously gathers CPU usage and memory-allocation information from your production applications1. Cloud Profiler can help you identify slow paths in your code and optimize the performance of your applications. Cloud Profiler supports applications written in Go that run on App Engine standard environment2. To use Cloud Profiler, you need to configure it in your Google Cloud project and initialize the cloud.google.com/go/profiler library in your application code3. You can then use the Cloud Profiler interface to analyze the profiling data and visualize the results by using flame graphs4. Cloud Profiler has minimal performance impact and management overhead, as it only samples a small fraction of the application activity and does not require any additional infrastructure or agents. The other options are incorrect because they do not meet the requirements of minimizing performance impact and management overhead. Option A is incorrect because it requires installing a continuous profiling tool into Compute Engine, which is an additional infrastructure that needs to be managed and maintained. Option B is incorrect because it requires periodically running the go tool pprof command against the application instance, which is a manual and disruptive process that can affect the application performance. Option D is incorrect because it only uses Cloud Monitoring to assess the App Engine CPU utilization metric, which is not enough to identify slow paths in the code or optimize the application performance. Reference: Cloud Profiler documentation, Overview. Profiling Go applications, Supported environments. Profiling Go applications, Using Cloud Profiler. Analyzing data, Analyzing data.
Question 100
You are building and deploying a microservice on Cloud Run for your organization Your service is used by many applications internally You are deploying a new release, and you need to test the new version extensively in the staging and production environments You must minimize user and developer impact. What should you do?
Correct Answer: C
The best option for deploying a new release of your microservice on Cloud Run and testing it extensively in the staging and production environments with minimal user and developer impact is to deploy the new version of the service to the staging environment with a new-release tag without serving traffic, test the new-release version, and if the test passes, gradually roll out this tagged version. A tag is a label that you can assign to a revision of your service on Cloud Run. You can use tags to create different versions of your service without affecting traffic. You can also use tags to gradually roll out traffic to a new version of your service by using traffic splitting. This way, you can test your new release extensively in both environments and minimize user and developer impact.