How to get logging level of a pod given pod-name and namespace name in K8s?

5/25/2020

How to i get logging level of a pod given the pod name and Namespace name

if its not possible to get Logging level then please tell me why

-- Pradeep Padmanaban
amazon-web-services
google-cloud-platform
kubernetes
microk8s

1 Answer

5/25/2020

With kubectl command you can perform this

kubectl logs <pod name> --namespace <namespace> [-c <container name>]

The container name is required is you have several container in your pod

In the GUI of GCP, you can do a custom filter like this

resource.type="k8s_pod"
resource.labels.location="us-central1-c"
resource.labels.cluster_name="cluster-2"
jsonPayload.involvedObject.namespace="namespace"
jsonPayload.involvedObject.name="pod name"

enter image description here

-- guillaume blaquiere
Source: StackOverflow