Reputation: 21
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
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
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:
Here you can find a complete guide to implement the pub/sub notifications.
Upvotes: 0
Reputation: 473
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.
resource.type=("k8s_container" OR "container" OR "k8s_cluster" OR "gke_cluster" OR "gke_nodepool" OR "k8s_node")
If you want to be more specific in your query you can use this:
"google.container.v1.ClusterManager.UpdateCluster"
and this query shows you only the master upgrade messages:
Please ensure the Cloud Logging is properly enabled.
In the Google Cloud Console, click your cluster's name:
In the Details panel for your cluster, see the status for Cloud Logging and Cloud Monitoring
Go to the GKE Kubernetes clusters page for your project:
Click the name of your cluster.
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.
In the dialog that appears, select which logs or metrics you want sent to Cloud Logging or Cloud Monitoring.
Click Save.
Upvotes: 0