
Explanation:
The correct answer is B because the requirement is to view logs across all clusters and replicas. Google Kubernetes Engine (GKE) integrates with Google Cloud Logging by default, which aggregates logs from all Pods in all clusters. Using gcloud logging read [PARAM] with appropriate filters (e.g., resource type k8s_container and deployment labels) retrieves logs centrally. Options A, C, and D are incorrect: kubectl logs (A) is cluster-specific and requires manual pod selection, kubectl exec (C) accesses a single Pod's logs via journalctl (not suitable for containerized apps), and gcloud compute ssh (D) retrieves node-level logs, not application stdout logs across clusters.
Ultimate access to all questions.
How can you view the logs sent to stdout for all replicas of a Deployment running across multiple Google Kubernetes Engine clusters?
A
kubectl logs [PARAM]
B
gcloud logging read [PARAM]
C
kubectl exec ג€"it [PARAM] journalctl
D
gcloud compute ssh [PARAM] ג€"-command= ג€sudo journalctlג€
No comments yet.