Skip to content
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

Horizontal Pod Autoscaler - Ranges #125987

Open
Leonardo-Ferreira opened this issue Jun 28, 2024 · 9 comments
Open

Horizontal Pod Autoscaler - Ranges #125987

Leonardo-Ferreira opened this issue Jun 28, 2024 · 9 comments
Labels
kind/feature Categorizes issue or PR as related to a new feature. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/autoscaling Categorizes an issue or PR as relevant to SIG Autoscaling.

Comments

@Leonardo-Ferreira
Copy link

Which component are you using?:

Horizontal Pod Autoscaler

Is your feature request designed to solve a problem? If so describe the problem this feature should solve.:

My feature is meant to allow an easier control of your deployment total capacity

Describe the solution you'd like.:

Let's say that im scaling out/in based on CPU. I would like to be able to express that my IF my deployment usage of cpu is:

  • inferior to 30%, a scale in operation should take place
  • superior to 75%, a scale out operation should take place

any value in between, and the deployment stays put.

I imagine that the yml should look like:

spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment 
    name: sample-app
  minReplicas: 1
  maxReplicas: 10
  metrics:
  - type: Resource
    resource:
      name: cpu
      range: #NOT target, but RANGE!
        type: Utilization
        minUtilization: 30
        maxUtilization: 75

Describe any alternative solutions you've considered.:

Couldn't come up with alternative solutions

Additional context.:

I would be willing to help coding this feature

@raywainman
Copy link

Interesting idea...

This sounds very similar to what tolerance tries to do, except here you are specifying it on a per-HPA basis.

Does modifying the tolerance value help you at all? (Note that not all Cloud providers expose this to users as a configurable parameter).

@Leonardo-Ferreira
Copy link
Author

Leonardo-Ferreira commented Jul 2, 2024

given its a global value I can't really fiddle with it... would you be able to tell how the tolerance integrates with the formula desiredReplicas = ceil[currentReplicas * ( currentMetricValue / desiredMetricValue )]? perhaps desiredReplicas = ceil[currentReplicas * ( currentMetricValue / desiredMetricValue )] * abs(1-tolerance)

@raywainman
Copy link

The tolerance value isn't actually incorporated into the calculation itself, rather it is used as a check to see if we should still proceed with the calculation as seen below:

https://github.com/kubernetes/kubernetes/blob/83f99cbd4775a1d311df79537b4e26e4725a3128/pkg/controller/podautoscaler/replica_calculator.go#L135C2-L139C3

And yes, totally understand that having a global value here is hard to fiddle with.

@gjtempleton
Copy link
Member

Moving issue as HPA controller is part of the core

/transfer-issue kubernetes

@k8s-ci-robot k8s-ci-robot transferred this issue from kubernetes/autoscaler Jul 9, 2024
@k8s-ci-robot k8s-ci-robot added the needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. label Jul 9, 2024
@k8s-ci-robot
Copy link
Contributor

This issue is currently awaiting triage.

If a SIG or subproject determines this is a relevant issue, they will accept it by applying the triage/accepted label and provide further guidance.

The triage/accepted label can be added by org members by writing /triage accepted in a comment.

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-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. label Jul 9, 2024
@gjtempleton
Copy link
Member

/sig autoscaling

@k8s-ci-robot k8s-ci-robot added sig/autoscaling Categorizes an issue or PR as relevant to SIG Autoscaling. and removed needs-sig Indicates an issue or PR lacks a `sig/foo` label and requires one. labels Jul 9, 2024
@Leonardo-Ferreira
Copy link
Author

so, is there a process here? or we just wait for other key members take notice and discuss?

@Leonardo-Ferreira
Copy link
Author

any other feedback here?

@raywainman
Copy link

Sorry for the delay. Yes, basically we should try and solicit a bit more feedback from the community and then convert this to a KEP for more formal review. We have a SIG meeting on Mondays, I'd be happy to bring this one up if you like.

One thing to note - have you seen #116984? This is another take at this problem where I think the outcome is the same. We should probably pick one approach to move forward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/feature Categorizes issue or PR as related to a new feature. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. sig/autoscaling Categorizes an issue or PR as relevant to SIG Autoscaling.
Projects
None yet
Development

No branches or pull requests

4 participants