Google Cloud Professional Cloud DevOps Engineer — Question 146
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?
Answer options
- 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.
Correct answer: D
Explanation
The correct answer, D, creates an exclusion filter that prevents less critical logs, such as DEBUG-level logs, from being stored, thus reducing logging costs. Options A and B are focused on enabling different logging types but do not address cost reduction. Option C disables the default logging sink entirely, which would lead to a complete loss of operational logs.