Installation
The easiest way to install a Custom Pod Autoscaler is using the Custom Pod Autoscaler Operator, follow the installation guide for instructions for installing the operator.
Once the operator is installed, you can now use the new CustomPodAutoscaler
Kubernetes Resource
to deploy autoscalers.
For an example, taken from the
getting started guide
and the
example code
in a file called cpa.yaml
:
apiVersion: custompodautoscaler.com/v1
kind: CustomPodAutoscaler
metadata:
name: python-custom-autoscaler
spec:
template:
spec:
containers:
- name: python-custom-autoscaler
image: python-custom-autoscaler:latest
imagePullPolicy: IfNotPresent
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: hello-kubernetes
config:
- name: interval
value: "10000"
kubectl apply -f cpa.yaml
.