Kubernetes Custom Time-Based Scaler

3/18/2019

I'm looking to find a way to write a scaler for my application which is running on Minikube to scale it up and down based on Time Stamps. Any idea?

-- ahmokhtari
kubernetes
kubernetes-helm
minikube

1 Answer

3/18/2019

That would be an Horizontal Pod Autoscaler (see its Walkthrough here), which would automatically scales the number of pods in a replication controller, deployment or replica set based on observed CPU utilization (or, with custom metrics support, on some other application-provided metrics)

In your case, the custom metric would be the time.

You can then follow "Kubernetes: Horizontal Pod Autoscaler using Minikube" from Tommy Elmesewdy as a practical example to implement one such autoscaler on Minikube.

In your case, you should ensure custom metrics are enabled:

minikube start --extra-config kubelet.EnableCustomMetrics=true
-- VonC
Source: StackOverflow