PROFESSIONAL-CLOUD-DEVELOPER · Question #100
Your application is running in multiple Google Kubernetes Engine clusters. It is managed by a Deployment in each cluster. The Deployment has created multiple replicas of your Pod in each cluster. You
The correct answer is B. gcloud logging read [PARAM]. The correct command is 'gcloud logging read' because logs from GKE pods across multiple clusters are aggregated in Cloud Logging (formerly Stackdriver). Since the requirement is to view logs across ALL clusters and ALL replicas in a Deployment, a single 'kubectl logs' command (A)
Question
Options
- Bgcloud logging read [PARAM]
- Ckubectl exec -it [PARAM] journalctl
How the community answered
(21 responses)- B71% (15)
- C29% (6)
Explanation
The correct command is 'gcloud logging read' because logs from GKE pods across multiple clusters are aggregated in Cloud Logging (formerly Stackdriver). Since the requirement is to view logs across ALL clusters and ALL replicas in a Deployment, a single 'kubectl logs' command (A) only targets a single pod in a single cluster - it cannot span multiple clusters. 'kubectl exec -it journalctl' (C) is used for interactive shell sessions to inspect system journal logs on a node, not for application stdout logs across many pods. Only 'gcloud logging read' with appropriate filters (such as by Deployment name or label) can query centralized logs aggregated from all GKE clusters at once.
Topics
Community Discussion
No community discussion yet for this question.