-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add new hpa aggregator for centralized-hpa mode #293
feat: add new hpa aggregator for centralized-hpa mode #293
Conversation
223b474
to
0799a3b
Compare
go.mod
Outdated
k8s.io/klog/v2 v2.90.1 | ||
k8s.io/utils v0.0.0-20221128185143-99ec85e7a448 | ||
k8s.io/kube-openapi v0.0.0-20230426210814-b0c0aaee3cc0 | ||
k8s.io/kubernetes v1.26.6 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depending on k8s.io/kubernetes
is not supported. Which part relies on this import?
b54b038
to
eb4216e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are a little lint error. If it can be fixed, fix it. If it doesn't need to be fixed, add a no-lint comment.
36d0b7b
to
3ecbd93
Compare
3ecbd93
to
ea23bb5
Compare
A new HPA aggregator component is introduced to implement the capabilities of centralized HPA. It is essentially a lightweight agent and an aggregator that provides aggregated information for HPA controllers.
Only when an HPA resource has the label
kubeadmiral.io/centralized-hpa-enabled: true
, the HPA controller can read the HPA resource through the HPA aggregator. In this way, any kind of HPAs can be supported non-intrusively for our centralized HPA mode, and any HPA controller the user has been used can be easily reuse in federation without multi-cluster adaptation.The HPA aggregator will aggregate the pod information of all member clusters (in order to prevent duplicate names, a name will be regenerated with the cluster name). It also implements
metrics.k8s.io
andcustom.metrics.k8s.io
, from which the HPA controller can obtain aggregation pod metric information or custom metric information to provide data support for auto scaling workloads.The HPA controller's scale up/scale down operations for the workload will also be forwarded to the KubeAdmiral apiserver. How these replicas are ultimately scheduled still depends on the kubeadmiral controller.
You can use
make local-up
to try it.Note: HPA aggregator will use the permissions carried in the request to forward resource requests, so authorization is still required. However, the only exception is that aggregated pod information currently cannot be effectively authorized, so requests for pods only support read-only operations and do not support subresources of pod.