Our great sponsors
-
metrics-server
Scalable and efficient source of container resource metrics for Kubernetes built-in autoscaling pipelines.
-
prometheus-operator
Prometheus Operator creates/configures/manages Prometheus clusters atop Kubernetes
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
metrics-on-kind
Custom and external metrics setup on KinD cluster with Prometheus Operator and Prometheus Adapter
-
predictive-horizontal-pod-autoscaler
Horizontal Pod Autoscaler built with predictive abilities using statistical models
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
Next, we will also need to deploy services that collect metrics based on which we will later scale our test application. First of these is Kubernetes metrics-server which is usually available in cluster by default, but that's not the case in KinD, so to deploy it we need to run:
Prometheus Operator to gather the custom/external metrics.
ServiceMonitor object(s) to tell Prometheus how to scrape our application's metrics.
Prometheus adapter to get custom/external metrics from Prometheus instance into Kubernetes API.
For a full rationale and algorithm details see KEP-2189.
In this article, I tried to cover most of the things you can do with Kubernetes HPA to scale your application. There are however, many more tools and options for scaling applications running in Kubernetes, such as vertical pod autoscaler which can help to keep Pod resource requests and limits up-to-date.
Another option would be predictive HPA by Digital Ocean, which will try to predict how many replicas a resource should and application have.