vorburger
vorburger

Reputation: 3928

How to enable & use workload monitoring on a GKE Autopilot mode cluster

The Autopilot overview doc claims that a Google Cloud Kubernetes Engine (GKE) cluster in Autopilot mode supports Monitoring Pre-configured: System monitoring but Optional: System and workload monitoring.

I would like to use said workload monitoring on an Autopilot cluster, with a apiVersion: monitoring.gke.io/v1alpha1 and kind: PodMonitor CRD, as documented here.

However, the UI says "Cloud Monitoring cannot be edited in Autopilot clusters." and gcloud container clusters update my-cluster --monitoring=WORKLOAD says ERROR: (gcloud.container.clusters.update) Must include system monitoring if any monitoring is enabled. but the same with --monitoring=SYSTEM,WORKLOAD says ERROR: (gcloud.container.clusters.update) INVALID_ARGUMENT: Request contains an invalid argument.

How do you use workload monitoring in Autopilot clusters?

Upvotes: 1

Views: 770

Answers (1)

vorburger
vorburger

Reputation: 3928

The trick, for now, is to use not the Web Console UI but the CLI with gcloud beta, as documented here: "Note: GKE workload metrics is currently a Preview, so be sure to use the gcloud beta commands."

Also note that "GKE workload metrics requires GKE control plane version 1.20.8-gke.2100 or later", as documented here.

Upvotes: 2

Related Questions