Skip to content

Kubernetes Cluster Logs

Overview⚓︎

This guide gives basic instructions for finding and viewing logs with kubectl or k9s.

Kubernetes logging is available through kubectl or k9s. The Google Kubernetes Engine also gives a console view on the Operations Logging page.

Log files make troubleshooting and pinpointing issues easier.

Use kubectl to list and view pod logs⚓︎

To get the logs for a Kubernetes instance:

  1. Run kubectl get pods for a list of your pods.
  2. Use kubectl logs PODNAME_TO_VIEW --namespace=$HDX_KUBERNETES_NAMESPACE to see specific logs.

Use k9s to view logs⚓︎

To see logs in k9s:

  1. Launch k9s from a terminal to connect to the current Kubernetes context.
  2. Select a pod to view.
  3. Open the Logs panel for the selected pod.