Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to find the pod that led to an error in GKE

If I look at my logs in GCP logs, I see for instance that I got a request that gave 500

  log_message: "Method: some_cloud_goo.Endpoint failed: INTERNAL_SERVER_ERROR"   

I would like to quickly go to that pod and do a kubectl logs on it. But I did not find a way to do this.

I am fairly new to k8s and GKE, any way to traceback the pod that handled that request?

like image 407
Al Wld Avatar asked Sep 11 '25 00:09

Al Wld


1 Answers

You could run command "kubectl get pods " on each node to check the status of all pods and could figure out accordingly by running for detail description of an error " kubectl describe pod pod-name"

like image 144
Neelam Avatar answered Sep 13 '25 20:09

Neelam