Category: Data, Kubernetes, github, shell

Wow this was harder than it needed to be! If you’re reading this it’s likely that you have tried to sift through the mountains of documentation from Google and Kubernetes about using a custom metric to scale out your deployments and are thoroughly lost.

Below I’ll walk you through setting up custom metrics and configuring a Horizontal Pod Autoscaler to scale your GKE deployment based on that metric.

For this example we’ll use python but it can be easily translated to your language of choice using Google’s custom metric docs.

By creating this time series event we have prompted GCP to auto-generate a new custom metric and then immediately create the first time series event for this metric.

Related Articles