Skip to content
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

Merged
merged 8 commits into from
Dec 29, 2023

Conversation

JackZxj
Copy link
Collaborator

@JackZxj JackZxj commented Dec 7, 2023

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 and custom.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.

@JackZxj JackZxj force-pushed the feat/fed-hpa-aggregator branch 3 times, most recently from 223b474 to 0799a3b Compare December 8, 2023 03:37
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
Copy link
Member

@gary-lgy gary-lgy Dec 12, 2023

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?

@JackZxj JackZxj force-pushed the feat/fed-hpa-aggregator branch from b54b038 to eb4216e Compare December 14, 2023 07:20
REestrella

This comment was marked as outdated.

Copy link
Collaborator

@Poor12 Poor12 left a 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.

@JackZxj JackZxj force-pushed the feat/fed-hpa-aggregator branch 2 times, most recently from 36d0b7b to 3ecbd93 Compare December 29, 2023 08:56
@JackZxj JackZxj force-pushed the feat/fed-hpa-aggregator branch from 3ecbd93 to ea23bb5 Compare December 29, 2023 09:35
@JackZxj JackZxj merged commit 9f8034f into kubewharf:feat/fed-hpa Dec 29, 2023
4 of 5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants