Custom Pod Autoscaler program and base images, allows creation of Custom Pod Autoscalers
This project is supported by:
This is the Custom Pod Autoscaler (CPA) code and base images.
A Custom Pod Autoscaler is a Kubernetes autoscaler that is customised and user created. Custom Pod Autoscalers are designed to be similar to the Kubernetes Horizontal Pod Autoscaler. The Custom Pod Autoscaler framework allows easier and faster development of Kubernetes autoscalers. A Custom Pod Autoscaler can be created by using this project, extending the Docker base images provided and inserting your own logic; see the examples for more information.
A Custom Pod Autoscaler has a base program (defined in this repository) that handles interacting with user logic, for example by using shell commands and piping data into them. When developing a Custom Pod Autoscaler you define logic for two stages:
These two pieces of logic are all the custom logic required to build a Custom Pod Autoscaler, the base program will handle all Kubernetes API interactions for scaling/retrieving resources.
Developing this project requires these dependencies:
To view the docs, you need Python 3 installed:
To view docs locally you need some Python dependencies, run:
pip install -r docs/requirements.txt
It is recommended to test locally using a local Kubernetes managment system, such as k3d (allows running a small Kubernetes cluster locally using Docker).
Once you have a cluster available, you should install the Custom Pod Autoscaler Operator (CPAO) onto the cluster to let you install Custom Pod Autoscalers.
With the CPAO installed you can install your development builds of the CPA onto the cluster by building the image locally, and then build CPAs using the new development image.directory for choices), and then push the image to the K8s cluster's registry (to do that with k3d you can use the
k3d image importcommand). Once the autoscaler's image is available in the registry it can be deployed using
make- builds the CPA binary.
make docker- builds the CPA base images.
make test- runs the unit tests.
make lint- lints the code.
make beautify- beautifies the code, must be run to pass the CI.
make view_coverage- opens up any generated coverage reports in the browser.
make doc- hosts the documentation locally, at