PROFESSIONAL-CLOUD-DEVOPS-ENGINEER practice question 1 of 25

[Building and implementing CI/CD pipelines for a service] You need to enforce several constraint templates across your Google Kubernetes Engine (GKE) clusters. The constraints include policy parameters, such as restricting the Kubernetes API. You must ensure that the policy parameters are stored in a GitHub repository and automatically applied when changes occur. What should you do?

Full set: 205 questions
Answer options
A: Set up a GitHub action to trigger Cloud Build when there is a parameter change. In Cloud Build, run a gcloud CLI command to apply the change.
B: When there is a change in GitHub, use a web hook to send a request to Anthos Service Mesh, and apply the change.
C: Configure Anthos Config Management with the GitHub repository. When there is a change in the repository, use Anthos Config Management to apply the change. Correct answer
D: Configure Config Connector with the GitHub repository. When there is a change in the repository, use Config Connector to apply the change.
Correct Answer:
C. Configure Anthos Config Management with the GitHub repository. When there is a change in the repository, use Anthos Config Management to apply the change.
Explanation

Anthos Config Management is Google Cloud's purpose-built GitOps solution for managing configurations and policies across multiple Kubernetes clusters. By pointing Anthos Config Management to a GitHub repository, it automatically detects any changes (commits) to the constraint templates and their parameters. It then applies these changes to all enrolled GKE clusters, ensuring they are consistently in the state defined in the Git repository. This provides a declarative, automated, and auditable way to enforce policies, which is the core requirement of the question.

Why Incorrect

A. This is a custom CI/CD approach. While possible, it's less integrated and requires more manual scripting and maintenance than the managed GitOps solution provided by Anthos Config Management.
B. Anthos Service Mesh is used for managing service-to-service communication, security, and observability within a service mesh. It is not designed for cluster configuration or policy management from Git.
D. Config Connector manages Google Cloud resources (e.g., Cloud SQL, Pub/Sub) via the Kubernetes API. It does not manage Kubernetes-native policy objects or synchronize them from a Git repository.

References

1. Google Cloud, Anthos Config Management overview. "Anthos Config Management lets you create a common configuration... for all your administrative and policy needs... This configuration is stored in a central Git repository... Anthos Config Management checks for new commits and applies them to all clusters."

2. Google Cloud, Policy Controller overview. "Policy Controller is built on the open source Open Policy Agent (OPA) Gatekeeper project... You can manage and audit your policies by using Anthos Config Management..." This shows the direct integration for the use case described.

Scroll to Top