feat: modify web/workers for keda autoscaling #1447
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Currently, we have two different autoscaling states
keda-[hpa].With the introduction of standard support for KEDA autoscaling, there are three different edge-case transitions we should be able to handle smoothly:
a. Standard HPA -> Standard KEDA
b. Manual KEDA -> Standard KEDA
c. Standard KEDA -> Standard HPA
a and b are edge cases because the KEDA validating webhook blocks creation of a
ScaledObjectif the target deployment is managed by another HPA. This blocks the progression of the helm upgrade (helm creates the ScaledObject before deleting the old HPA. One way of handling this is specifying an annotation on the ScaledObject to make KEDA just adopt the existing HPA. Unfortunately this fix introduces the edge case c. During a helm upgrade for the transition in c, helm patches the standard HPA and then deletes the ScaledObject. The finalizer for the ScaledObject in turn deletes the HPA, leaving us with no autoscaling.The patches in this PR handle this by annotating the HPAs with
validations.keda.sh/hpa-ownership: "false"which makes the keda validation webhook pass them during the check. This means a and c can happen safely (KEDA will just create/delete a new HPA). b is a limited set of scenarios which we will handle on a case by case basis (we will use enabling the flag as a forcing function to do the check - we can patch the HPA with the necessary annotations).This PR also adds an annotation on web services to add a
porter.prometheus/scrapeannotation.