exam questions

Exam Professional Cloud Developer All Questions

View all questions & answers for the Professional Cloud Developer exam

Exam Professional Cloud Developer topic 1 question 51 discussion

Actual exam question from Google's Professional Cloud Developer
Question #: 51
Topic #: 1
[All Professional Cloud Developer Questions]

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?

  • A. kubectl logs [PARAM]
  • B. gcloud logging read [PARAM]
  • C. kubectl exec ג€"it [PARAM] journalctl
  • D. gcloud compute ssh [PARAM] ג€"-command= ג€sudo journalctlג€
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
omermahgoub
Highly Voted 1 year, 9 months ago
Answer is A: To view the logs sent to stdout for all replicas in a Deployment in multiple clusters, the correct command to use would be kubectl logs [PARAM]. The gcloud logging read command reads log entries from the specified logs. It does not allow you to view the logs of specific replicas in a Deployment across multiple clusters. kubectl logs allows you to view the logs of a specific Pod or Deployment across multiple clusters. You can specify the Deployment name and the relevant parameters to view the logs of all replicas in the Deployment. For example, the following command would allow you to view the logs of all replicas in a Deployment named "my-deployment" in all clusters: kubectl logs -l app=my-deployment --all-containers
upvoted 6 times
omermahgoub
1 year, 9 months ago
gcloud logging read [PARAM], can be used to read log entries from Stackdriver Logging, but it is not specifically designed for viewing the logs of Pods in a Kubernetes cluster. Additionally, gcloud logging read does not have a way to filter the log entries based on the Pod or Deployment, so it would not be possible to use it to view the logs for all of the replicas in a Deployment across multiple clusters
upvoted 1 times
...
...
tomato123
Highly Voted 2 years, 2 months ago
Selected Answer: B
B is correct
upvoted 5 times
...
santoshchauhan
Most Recent 7 months, 3 weeks ago
Selected Answer: B
B. gcloud logging read [PARAM]: Google Cloud's operations suite (formerly known as Stackdriver) aggregates logs from all the pods across all the GKE clusters. By using gcloud logging read, you can query these logs with specific parameters (like the name of the Deployment, container, or other filters) to view the combined logs from all replicas across all clusters. This command provides a centralized way to access logs at scale.
upvoted 1 times
...
__rajan__
1 year, 1 month ago
Selected Answer: B
B is correct
upvoted 1 times
...
edward_zhang
1 year, 8 months ago
choose B. gcloud logging also can be used for quering pod log https://stackoverflow.com/questions/62007471/how-to-view-container-logs-via-stackdriver-on-gke
upvoted 2 times
...
yogi_508
2 years, 6 months ago
B https://cloud.google.com/sdk/gcloud/reference/logging/read
upvoted 2 times
...
ParagSanyashiv
2 years, 9 months ago
Selected Answer: B
Correct answer is B
upvoted 1 times
...
PrissMedrano
2 years, 11 months ago
Selected Answer: B
Correct answer is B
upvoted 2 times
...
Valant
2 years, 12 months ago
Correct answer is B https://cloud.google.com/logging/docs/reference/tools/gcloud-logging#examples_2
upvoted 2 times
...
therealsohail
3 years ago
A and B
upvoted 1 times
...
[Removed]
3 years, 3 months ago
B) with parameters : resource.type=("k8s_container" OR "container" OR "k8s_cluster" OR "gke_cluster" OR "gke_nodepool" OR "k8s_node")
upvoted 1 times
...
celia20200410
3 years, 3 months ago
B: gcloud logging read Using the "gcloud logging read" command, select the appropriate cluster, node, pod, and container logs. https://cloud.google.com/stackdriver/docs/solutions/gke/using-logs#accessing_your_logs However if you use "kubectl logs" to see logs on CLI, logs won’t be seen readable. It prints each line as a JSON object. https://medium.com/google-cloud/display-gke-logs-in-a-text-format-with-kubectl-db0169be0282
upvoted 3 times
...
syu31svc
3 years, 3 months ago
https://kubernetes.io/docs/reference/kubectl/cheatsheet/ I would take A
upvoted 1 times
syu31svc
3 years, 2 months ago
Changing to B https://cloud.google.com/blog/products/management-tools/using-logging-your-apps-running-kubernetes-engine: "gcloud command line tool – Using the gcloud logging read command, select the appropriate cluster, node, pod and container logs."
upvoted 3 times
...
...
kernel1973
3 years, 4 months ago
B for me. gcloud logging read
upvoted 3 times
...
StelSen
3 years, 8 months ago
Option: B. (Link1: https://cloud.google.com/blog/products/management-tools/finding-your-gke-logs, Link2: https://cloud.google.com/sdk/gcloud/reference/logging/read)
upvoted 3 times
...
saurabh1805
3 years, 11 months ago
A seems to be correct answer.
upvoted 4 times
mastodilu
3 years, 5 months ago
doesn't this view the logs of a single cluster?
upvoted 2 times
kernel1973
3 years, 4 months ago
You need to change the cluster connection's in order to view the logs for a specific deployments.
upvoted 1 times
...
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago