Google Associate Cloud Engineer Question 296
Select 4Google Cloud PlatformYou are a Google Cloud engineer responsible for setting up logging for a new application running on Google Kubernetes Engine (GKE). You need to ensure that the logs from your GKE clusters are stored in a specific Cloud Logging bucket for long-term retention and are available for analytics. What steps should you take to configure this logging setup effectively?
- A
A. Create a log bucket in Cloud Logging and set the retention period.
- B
B. Configure a log sink with a filter to route logs from GKE to the specific log bucket.
- C
C. Enable the Cloud Logging API on your Google Cloud project.
- D
D. Create a BigQuery dataset and export logs from the log bucket to BigQuery for analytics.
- E
E. Deploy a Cloud Function to manually move logs from GKE to the log bucket.
Show answer and explanation
Correct answers: A, B, C, D
Explanation
To configure logging for a GKE application, you need to set up a log bucket to store logs. A log sink with appropriate filters will route GKE logs to this bucket. The Cloud Logging API must be enabled to manage logs. For analytics, exporting logs to BigQuery is efficient and allows you to analyze logs effectively without additional manual interventions like Cloud Functions.
- A. Correct.
A. Creating a log bucket and setting the retention period is essential for storing logs for long-term retention.
- B. Correct.
B. Configuring a log sink with a filter allows you to route specific logs from GKE to your designated log bucket.
- C. Correct.
C. Enabling the Cloud Logging API is necessary to ensure logs can be collected and managed within your project.
- D. Correct.
D. Exporting logs from the log bucket to BigQuery allows for efficient analytics processing, making it a suitable step for analyzing logs.
- E. Incorrect.
E. A Cloud Function is not required for moving logs. Log sinks and routing configurations handle log transfers automatically.