Which command is suitable for viewing logs from all replicas across multiple Kubernetes clusters?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Prepare for the Google Cloud Professional Cloud Developer Test. Benefit from mock assessments featuring flashcards and multiple-choice format, each furnished with hints and detailed explanations. Excel in your exam with confidence!

The chosen command, which involves using "gcloud logging read," is appropriate for viewing logs from all replicas across multiple Kubernetes clusters because it leverages Google Cloud's centralized logging service, Cloud Logging. This service aggregates logs from various sources, including Kubernetes clusters, and allows users to query and analyze logs efficiently across different environments. By using this command, users can specify filters, timeframes, and other parameters to retrieve specific logs that match their criteria, providing a comprehensive view of the activity within their Kubernetes deployments across clusters.

In contrast, the other options focus on interacting directly with Kubernetes pods or instances. The "kubectl logs" command retrieves logs from specific pods, which may limit visibility to only the individual pod referenced and does not aggregate logs from multiple clusters. "kubectl exec" is used for executing commands within a specific pod’s container and isn't intended for fetching logs across multiple clusters. Lastly, using "gcloud compute ssh" and accessing journal logs through SSH is a method that requires accessing individual VM instances, which doesn't provide an aggregated view of logs across all replicas or clusters, making it less effective for widespread logging analysis in multi-cluster environments.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy