Yuva Yuva
Yuva Yuva

Reputation: 21

What are the cloud logs to indentify the gke cluster upgarde deatils?

My GKE cluster got upgraded both master and node pool to the latest version and I would like to know what are the cloud logs related to cluster upgraded? payload filters? so that we would like to create metric-based alerts to know when there is a cluster upgrade that is taking place.

Upvotes: 0

Views: 1988

Answers (3)

Tal
Tal

Reputation: 11

It's also possible an internal upgrade would occur. to search for internal or manual upgrade use:

protoPayload.methodName=("google.container.v1.ClusterManager.UpdateCluster" OR "google.container.internal.ClusterManagerInternal.UpdateClusterInternal")

Upvotes: 1

Vicente Ayala
Vicente Ayala

Reputation: 301

According to the official k8s documentation, the way you should receive notifications for cluster upgrade is with pub/sub notifications.

GKE upgrade notifications provide the following benefits:

  • You receive proactive information about updates scheduled for your cluster, allowing you to better plan for testing and qualifications, and to help ensure a smooth and predicted upgrade process.
  • You are notified when there is a new GKE version that you can upgrade to. Previously, you had to check the GKE release notes or the GKE API to discover when a new GKE version was released.
  • You are notified when your cluster upgrades, including both user-initiated and GKE-initiated upgrades, providing you with more visibility into the background operations of your cluster.
  • Pub/Sub is highly extensible, giving you flexibility in how you process incoming notifications. For example, you could integrate with Slack to forward notifications to a Slack channel, or initiate Cloud Functions to run custom processes.
  • When custom processes are required (for example, orchestrating a staging to production workflow to test and certify an upgrade), you can use the notification to auto-trigger these workflows.

Here you can find a complete guide to implement the pub/sub notifications.

Upvotes: 0

Alejandro F.
Alejandro F.

Reputation: 473

UPDATED

I ran the mentioned query with the masterUpgrade message from the console. I ran this query today Nov. 17, 2021 at 9:43 CST timezone. The query shows the master upgrade.

Please use this query in the log explorer:


resource.type=("k8s_container" OR "container" OR "k8s_cluster" OR "gke_cluster" OR "gke_nodepool" OR "k8s_node")

You can find the value google.container.v1.ClusterManager.UpdateCluster

enter image description here

If you want to be more specific in your query you can use this:


 "google.container.v1.ClusterManager.UpdateCluster" 

enter image description here

and this query shows you only the master upgrade messages:

enter image description here

Please ensure the Cloud Logging is properly enabled.

To see the Cloud Logging and Cloud Monitoring integration settings for your cluster, follow these steps:

  1. In the Google Cloud Console, click your cluster's name:

  2. In the Details panel for your cluster, see the status for Cloud Logging and Cloud Monitoring

To change the Cloud Logging or Cloud Monitoring integration settings for an existing cluster, follow these steps:

  1. Go to the GKE Kubernetes clusters page for your project:

  2. Click the name of your cluster.

  3. To modify which logs are sent to Cloud Logging or which metrics are sent to Cloud Monitoring, click Edit edit next to Cloud Logging or Cloud Monitoring.

  4. In the dialog that appears, select which logs or metrics you want sent to Cloud Logging or Cloud Monitoring.

  5. Click Save.

Upvotes: 0

Related Questions