Viewing GKE logs using Stackdriver

Enabling Stackdriver Monitoring support allows you to easily monitor GKE clusters, debug logs, and analyze your cluster performance using advanced profiling and tracing capabilities. In this recipe, we will learn how to access the logs of our Kubernetes cluster on GKE. Follow these steps:

  1. From the Google Cloud Console, open the Stackdriver Logs Viewer by going to https://console.cloud.google.com/logs/viewer:

  1. From the Resources menu, click on the Kubernetes Container option:

  1. The Stackdriver Logging view will show a list of logs for your container in the selected GKE cluster. Here, you can see the container logs for the last 7 days being displayed:

  1. Filter the log level to Critical and set the time frame to the Last 24 hours to view the most recent critical container logs. An example result can be seen in the following screenshot:

      With that, you know how to use Stackdriver to view logs for GKE clusters and resources, such as containers that have been deployed on the GKE clusters.

      ..................Content has been hidden....................

      You can't read the all page of ebook, please click here login for view all page.
      Reset
      3.142.12.207