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
Add the VPAAndHPAForAPIServer
feature gate for the gardener-operator
#9735
base: master
Are you sure you want to change the base?
Add the VPAAndHPAForAPIServer
feature gate for the gardener-operator
#9735
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
a4651e6
to
25deeb4
Compare
8391e51
to
656589f
Compare
Hey @ialidzhikov, thanks for the PR! While looking at the changes, I was wondering if we're missing the removal code for HVPA, HPA and VPA objects for the cases when the |
For the kubernetes apiserver component (
For the gardener apiserver ( gardener/pkg/component/gardener/apiserver/apiserver.go Lines 145 to 153 in 876f6f0
Hence, for the gardener apiserver component returning nil from the |
/assign |
@@ -203,4 +203,4 @@ A *General Availability* (GA) feature is also referred to as a *stable* feature. | |||
| UseNamespacedCloudProfile | `gardener-apiserver` | Enables usage of `NamespacedCloudProfile`s in `Shoot`s. | | |||
| ShootManagedIssuer | `gardenlet` | Enables the shoot managed issuer functionality described in GEP 24. | | |||
| VPAForETCD | `gardenlet`, `gardener-operator` | Enables VPA for `etcd-main` and `etcd-events`, regardless of HVPA enablement. | | |||
| VPAAndHPAForAPIServer | `gardenlet` | Enables an autoscaling mechanism for shoot kube-apiserver where it is scaled simultaneously by VPA and HPA on the same metric (CPU and memory usage). The pod-trashing cycle between VPA and HPA scaling on the same metric is avoided by configuring the HPA to scale on average usage (not on average utilization) and by picking the target average utilization values in sync with VPA's allowed maximums. The feature gate takes precedence over the `HVPA` feature gate when they are both enabled. | | |||
| VPAAndHPAForAPIServer | `gardenlet`, `gardener-operator` | Enables an autoscaling mechanism for shoot kube-apiserver where it is scaled simultaneously by VPA and HPA on the same metric (CPU and memory usage). The pod-trashing cycle between VPA and HPA scaling on the same metric is avoided by configuring the HPA to scale on average usage (not on average utilization) and by picking the target average utilization values in sync with VPA's allowed maximums. The feature gate takes precedence over the `HVPA` feature gate when they are both enabled. | |
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.
| VPAAndHPAForAPIServer | `gardenlet`, `gardener-operator` | Enables an autoscaling mechanism for shoot kube-apiserver where it is scaled simultaneously by VPA and HPA on the same metric (CPU and memory usage). The pod-trashing cycle between VPA and HPA scaling on the same metric is avoided by configuring the HPA to scale on average usage (not on average utilization) and by picking the target average utilization values in sync with VPA's allowed maximums. The feature gate takes precedence over the `HVPA` feature gate when they are both enabled. | | |
| VPAAndHPAForAPIServer | `gardenlet`, `gardener-operator` | Enables an autoscaling mechanism for `kube-apiserver` of shoot or virtual garden clusters, and the `gardener-apiserver`. They are scaled simultaneously by VPA and HPA on the same metric (CPU and memory usage). The pod-trashing cycle between VPA and HPA scaling on the same metric is avoided by configuring the HPA to scale on average usage (not on average utilization) and by picking the target average utilization values in sync with VPA's allowed maximums. The feature gate takes precedence over the `HVPA` feature gate when they are both enabled. | |
return g.horizontalPodAutoscalerInVPAAndHPAMode() | ||
} | ||
|
||
func (g *gardenerAPIServer) horizontalPodAutoscalerInVPAAndHPAMode() *autoscalingv2.HorizontalPodAutoscaler { |
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.
return g.horizontalPodAutoscalerInVPAAndHPAMode() | |
} | |
func (g *gardenerAPIServer) horizontalPodAutoscalerInVPAAndHPAMode() *autoscalingv2.HorizontalPodAutoscaler { |
// The chosen value is 6 CPU: 1 CPU less than the VPA's maxAllowed 7 CPU in VPAAndHPA mode to have a headroom for the horizontal scaling. | ||
hpaTargetAverageValueCPU := resource.MustParse("6") | ||
// The chosen value is 24G: 4G less than the VPA's maxAllowed 28G in VPAAndHPA mode to have a headroom for the horizontal scaling. | ||
hpaTargetAverageValueMemory := resource.MustParse("24G") |
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.
You could use ptr.To()
instead of defining these variables here.
How to categorize this PR?
/area auto-scaling
/kind enhancement
What this PR does / why we need it:
Which issue(s) this PR fixes:
Part of #9562
A follow-up of #9678
Special notes for your reviewer:
This PR is based on Introduce a new autoscaling mode (The PR is now rebased after the merge of Introduce a new autoscaling mode (VPAAndHPA
) for Shoot Kubernetes API servers #9678, hence it is in draft state until Introduce a new autoscaling mode (VPAAndHPA
) for Shoot Kubernetes API servers #9678 is merged.VPAAndHPA
) for Shoot Kubernetes API servers #9678.Release note: