在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称(OpenSource Name):kubernetes-sigs/cluster-proportional-autoscaler开源软件地址(OpenSource Url):https://github.com/kubernetes-sigs/cluster-proportional-autoscaler开源编程语言(OpenSource Language):Go 86.7%开源软件介绍(OpenSource Introduction):Horizontal cluster-proportional-autoscaler containerOverviewThis container image watches over the number of schedulable nodes and cores of the cluster and resizes the number of replicas for the required resource. This functionality may be desirable for applications that need to be autoscaled with the size of the cluster, such as DNS and other services that scale with the number of nodes/pods in the cluster. Usage of cluster-proportional-autoscaler:
Installation with helmAdd the cluster-proportional-autoscaler Helm repository: helm repo add cluster-proportional-autoscaler https://kubernetes-sigs.github.io/cluster-proportional-autoscaler
helm repo update Then install a release using the chart. The charts default values file provides some commented out examples for setting some of the values. There are several required values, but helm should fail with messages that indicate which value is missing. helm upgrade --install cluster-proportional-autoscaler \
cluster-proportional-autoscaler/cluster-proportional-autoscaler --values <<name_of_your_values_file>>.yaml ExamplesPlease try out the examples in the examples folder. Implementation DetailsThe code in this module is a Kubernetes Golang API client that, using the default service account credentials available to Golang clients running inside pods, it connects to the API server and polls for the number of nodes and cores in the cluster. The scaling parameters and data points are provided via a ConfigMap to the autoscaler and it refreshes its parameters table every poll interval to be up to date with the latest desired scaling parameters. Calculation of number of replicasThe desired number of replicas is computed by using the number of cores and nodes as input of the chosen controller. This may be later extended to more complex interpolation or exponential scaling schemes
but it currently supports Control patterns and ConfigMap formatsThe ConfigMap provides the configuration parameters, allowing on-the-fly changes(including control mode) without rebuilding or restarting the scaler containers/pods. Currently the two supported ConfigMap key value is: Linear ModeParameters in ConfigMap must be JSON and use
The equation of linear control mode as below:
When For instance, given a cluster has 4 nodes and 13 cores. With above parameters, each replica could take care of 1 node.
So we need When Either one of the Side notes:
Ladder ModeParameters in ConfigMap must be JSON and use
The ladder controller gives out the desired replicas count by using a step function. The step ladder function uses the datapoint for core and node scaling from the ConfigMap. The lookup which yields the higher number of replicas will be used as the target scaling number. For instance, given a cluster comes with Either one of the Replicas can be set to 0 (unlike in linear mode). Scaling to 0 replicas could be used to enable optional features as a cluster grows. For example, this ladder would create a single replica once the cluster reaches six nodes.
Comparisons to the Horizontal Pod Autoscaler featureThe Horizontal Pod Autoscaler is a top-level Kubernetes API resource. It is a closed feedback loop autoscaler which monitors CPU utilization of the pods and scales the number of replicas automatically. It requires the CPU resources to be defined for all containers in the target pods and also requires heapster to be running to provide CPU utilization metrics. This horizontal cluster proportional autoscaler is a DIY container (because it is not a Kubernetes API resource) that provides a simple control loop that watches the cluster size and scales the target controller. The actual CPU or memory utilization of the target controller pods is not an input to the control loop, the sole inputs are number of schedulable cores and nodes in the cluster. There is no requirement to run heapster and/or provide CPU resource limits as in HPAs. The ConfigMap provides the operator with the ability to tune the replica scaling explicitly. Using NodeLabelsNodelabels is an optional param to count only nodes and its cpus where the nodelabels exits. This is useful when nodeselector is used on the target pods controller so its needed to take account only the nodes tagged with the nodeselector labels to calculate the total replicas to scale. When the param is ignored then the cluster proportional autoscaler counts all schedulable nodes and its cpus. |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论