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
Fix conflicting Serverless scaling options #15576
Conversation
/hold |
components/function-controller/pkg/apis/serverless/v1alpha2/function_defaults.go
Outdated
Show resolved
Hide resolved
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.
my 3 cents:
I see the benefits of the proposed idea.
I understand you tried to separate those scalability modes and distinguish which resource is scaled to avoid collisions.
But I think there are also problems.. for instance :
- if the external scaler is used than it pollutes the scaleConfig (as replicas override the scaleConfig.. or did I get it wrong?)
- the necessity to clear the replicas field in order to bring back serverless managed HPA. It would be more natural to me to clear the scaleConfig as in "I dont want you to scale it.. I will scale myself"
- two sources of truth for scaling ( replicas and scaleconifg ) could be error prone and increase maintenance costs
I like to see the spec.scaleConfig
a way to help user to configure a very basic scaler.
I believe this basic scaler (HPA) should target function.. this way function.spec.replicas would become the single source of truth for replication.
If the user enable other HPAs referencing the function indeed there might be collisions of two or more scalers trying to overrule others and set the number of replicas... but he can always do that, cant he? ( i.e by applying multiple scaledObjects). Its user's responsibility to model scalers that would not conflict with each other.
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.
In general, this proposal looks ok. I have only one small suggestion for it - I think mirroring
value of the spec.replicas
in the spec.scaleConfig
looks a little bit tricky. As a user, I would be really confused after reading the documentation, where we write that scaleConfig
is used to define internal hpa, and then after applying an external one the scaleConfig
has exactly the same values as replicas (?) and this config is following values from replicas? It would be really confusing.
I would suggest the other solution to our problem:
spec.replicas
is THE ONLY ONE source of truth for any functionality in the function-controllerspec.scaleConfig
is ONLY used to create an internal scaler (and should be not used in any other way) - ifspec.scaleConfig
== nil, then do nothing- Internal scalers should refer to function, not deployment
I think the huge advantage of this proposition is simplicity ( simple code == simple documentation == functionality easy to understand ).
I remember a few discussions about what if the user would use scaleConfig and external scaler at the same time?
and I think this question is totally not a case because if we would make scaleConfig
optional and users would enable it intentionally then it's not our fault that it would not work :D the exact same case would be when the user will use two (or more) external scalers for one function at the same time.
What do you think about it @moelsayed? I don't want to decide which proposition is better I only want to open a discussion to talk about it because I think it's really important to decide on the such thing right now before we will make a mistake.
components/function-controller/pkg/apis/serverless/v1alpha2/function_defaults.go
Outdated
Show resolved
Hide resolved
560b45a
to
f0c09f4
Compare
df43ad6
to
b4f80c4
Compare
…/scaling.go Co-authored-by: Damian Badura <45110612+dbadura@users.noreply.github.com>
Co-authored-by: Grzegorz Karaluch <grzegorz.karaluch@sap.com>
Co-authored-by: Grzegorz Karaluch <grzegorz.karaluch@sap.com>
Co-authored-by: Grzegorz Karaluch <grzegorz.karaluch@sap.com>
Co-authored-by: Grzegorz Karaluch <grzegorz.karaluch@sap.com>
Co-authored-by: Grzegorz Karaluch <grzegorz.karaluch@sap.com>
Co-authored-by: Grzegorz Karaluch <grzegorz.karaluch@sap.com>
Co-authored-by: Grzegorz Karaluch <grzegorz.karaluch@sap.com>
Co-authored-by: Grzegorz Karaluch <grzegorz.karaluch@sap.com>
Co-authored-by: Grzegorz Karaluch <grzegorz.karaluch@sap.com>
Co-authored-by: Grzegorz Karaluch <grzegorz.karaluch@sap.com>
Co-authored-by: Grzegorz Karaluch <grzegorz.karaluch@sap.com>
Co-authored-by: Grzegorz Karaluch <grzegorz.karaluch@sap.com>
/test pull-function-controller-unit-test |
/retest |
@moelsayed: The following tests failed, say
Full PR test history. Your PR dashboard. 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. I understand the commands that are listed here. |
Description
Changes proposed in this pull request:
Related issue(s)
#15152