CAPI Cluster Auto-Scaler Addon
Introduction
The Platform9 managed Cluster Autoscaler for CAPI clusters ensures the resources of the Kubernetes Cluster Worker Node Groups are never exhausted. More specific information about Cluster Autoscaler for CAPI can be found on its specific GitHub pages.
Description
The CAPI Cluster Auto-Scaler add-on continually verifies the number of needed pods that are pending allocation for particular Node Groups. If there are pods that are pending for allocation on a particular Node Group nodes, new nodes are then provisioned and added to the node group to accommodate the demand. When demand drops and fewer nodes are needed, the auto-scalar scales down the node groups. After the autoscaler add-on is enabled and the node-groups are annotated for auto-scalar, the behaviour of the auto-scalar is automatic, so users only need to define the number of replicas to be deployed.
Settings
The CAPI Cluster Auto-Scaler needs to be enabled with cluster creation or post-cluster creation from the add-ons section.
Annotating a Node Group for Auto-scalar
Following annotations need to be added to the instance of the node group custom resources.
Example:
apiVersion: cluster.x-k8s.io/v1beta1kind: MachineDeploymentmetadata: name: test-md-0 namespace: default annotations: cluster.x-k8s.io/cluster-api-autoscaler-node-group-min-size: '3' cluster.x-k8s.io/cluster-api-autoscaler-node-group-max-size: '10'spec: ...YAML Specifications
apiVersionsunpike.platform9.com/v1alpha2kindClusterAddonmetadata labels sunpike.pf9.io/cluster'<clsuuid>' typecluster-auto-scaler-capi name<clsuuid>-cluster-auto-scaler-capi namespacedefaultspec clusterID'<clsuuid>' override paramsnameclusterAutoscalerNamespace valuekube-systemnameclusterNamespace valuetest-namespacenameextraArgs valuetest_key=test_value,test_key2=test_value2 typecluster-auto-scaler-capi version1.21.1 watchtrueConclusion
Should you encounter any difficulties adopting or deploying the information noted above, our talented and responsive support team is available 24/7/365 to provide any additional assistance needed.