use the /scale subresource to when updating replica count#16540
use the /scale subresource to when updating replica count#16540knative-prow[bot] merged 2 commits intoknative:mainfrom
Conversation
This has the added benefit of not having to deepcopy and computing a JSONPatch via diffing two json byte strings which would take about 400ms
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #16540 +/- ##
==========================================
+ Coverage 80.15% 80.23% +0.08%
==========================================
Files 217 217
Lines 13547 13532 -15
==========================================
- Hits 10859 10858 -1
+ Misses 2319 2310 -9
+ Partials 369 364 -5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This property is no longer needed by the autoscaler so we don't need to store the PodTemplate in memory
|
/assign @linkvt |
| resourceNames: ["knative-serving-certmanager"] | ||
| - apiGroups: ["*"] | ||
| resources: ["*/scale"] | ||
| verbs: ["patch"] |
There was a problem hiding this comment.
@dprotaso I assume, this is intentionally wide to allow for scaling different resourecs like mentioned in the issue CloneSet, AppSet. Correct?
|
/lgtm For other reviewers |
linkvt
left a comment
There was a problem hiding this comment.
Nice, clean change - didn't expect it to be that simple!
Also didn't know that the JSON Patch add operation is more forgiving than replace 💡
/lgtm
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: dprotaso, linkvt 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 |
|
/hold cancel |
|
👍 |
This replaces #16419
Fixes #15528
Some notable differences
Getsince that is an API call - we don't want to do that for every scale call.spec.templatefromPodScalablesince we don't need it to scale the resourceJSONPatch via diffing two json byte strings which would take about 400ms
For now we expected the
spec.replicasto be the patch required to update the replica count.Note: we don't use the scale client to
Getthe resource prior since it will hit the API serverRelease Note