Custom metrics with HorizontalPodAutoscaler on GKE
I am trying to set up custom metrics using HorizontalPodAutoscaler
a 1.6.1 alpha GKE cluster.
According to https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#prerequisites I need to set --horizontal-pod-autoscaler-use-rest-clients
to kube-controller-manager
to enable metrics collection. It is not clear from GKE if flags can be set on kube-controller-manager
. Any ideas?
Anyone got any custom metrics working with HPA on GKE?
source to share
In GKE we have been supporting HPA with custom metrics since version 1.9. If you have a group of horizontally autoscaled containers within your cluster, each exporting a custom metric, you can set an average for each unit of measure for that metric.
An example of this would be an autoscaled interface deployment, where each replica exports the current QPS. You can set the QPS medium target to a plug-in and use HPA to scale your deployment up and down, respectively. You can find documentation and tutorial explaining how to install this here: https://cloud.google.com/kubernetes-engine/docs/tutorials/custom-metrics-autoscaling
Kubernetes 1.10, available in GKE, will expand support for custom metrics to include metrics that are not tied to any Kubernetes object. This will give you the ability to scale your deployment based on any metric specified here, such as the number of posts in the Google Pub / Sub queue.
source to share