nerdexam
Google

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)

Logging and Monitoring Google Kubernetes Engine Applications

Question

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 want to view the logs sent to stdout for all of the replicas in your Deployment in all clusters. Which command should you use? kubectl logs [PARAM] A.

Options

  • Bgcloud logging read [PARAM]
  • Ckubectl exec -it [PARAM] journalctl

How the community answered

(21 responses)
  • B
    71% (15)
  • C
    29% (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

#Cloud Logging#Google Kubernetes Engine (GKE)#Application Monitoring#Troubleshooting

Community Discussion

No community discussion yet for this question.

Full PROFESSIONAL-CLOUD-DEVELOPER Practice