Repository navigation
Conversation
Signed-off-by: shaoyue <haorenfsa@gmail.com>
|
@haorenfsa: The label(s) DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: haorenfsa The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
This pull request is closed, so it cannot be queued. Reopen it to get the box back. |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #595 +/- ##
==========================================
+ Coverage 86.06% 86.15% +0.09%
==========================================
Files 76 77 +1
Lines 7663 7749 +86
==========================================
+ Hits 6595 6676 +81
- Misses 1066 1071 +5
Partials 2 2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Allow v1 HPA cleanup during an active rollout or upgrade stop before validating settings for HPA creation. Protect cleanup with Kubernetes delete preconditions and share HPA metadata and replica limits across API versions. Signed-off-by: shaoyue <haorenfsa@gmail.com>
Fixes #592. Related to #594.
Summary
On Kubernetes 1.21.5, the Operator queries
autoscaling/v2while reconciling every component, including components that have never configured native HPA. The API is unavailable on that cluster, so the reconcile fails before it can finish.Discover HPA API support before reconciling component workloads. Prefer
autoscaling/v2, fall back toautoscaling/v1on APINoMatch, and propagate other discovery errors.When only v1 is served, reconcile and clean up operator-owned HPAs. Support a single CPU utilization target, with 80% as the default. Report metrics or scaling behavior that require v2 before changing component workloads.
When neither API is served, skip HPA reconciliation for instances without native HPA and return a component-specific error for explicit HPA configuration.
Keep HPA suspension available through v1 during an active rollout or upgrade stop. Require the same UID and resource version when deleting an HPA so a replacement or updated owner is preserved.
Validation
operator-hpa-595-review-r2-1204passed the HPA regression tests andgo test ./pkg/controllers/... -short -count=1with Go 1.27.4.