Giter VIP home page Giter VIP logo

Comments (5)

CharlyF avatar CharlyF commented on September 25, 2024

Hello @cforce!
We are following the same design pattern as the upstream HPA, meaning that if you use several metrics the one that yields the greatest scaling event takes precedence.
As you can see here in the controller's code we loop over all of the metrics listed in the spec of a WPA (regardless of their type, to address your question about mixing types, it is supported). Then we keep the highest "recommendation" here. We also take a conservative approach, in the case of a downscale, we will downscale to the highest recommendation (to prevent sudden large downscale as opposed to the upscale event).

And what happens if memory is at 90% and cpu at 50%? Will it scale up or down?

it will scale to whatever is the highest number of replicas recommended given each metric compared to their watermarks and the current number of ready pods.

To address your last point, if one of the metric yields a scaling event, then it takes precedence even if we are within the bounds in the other one. This is because we compare metrics independently to their watermarks.

Let us know if you have any more questions!

from watermarkpodautoscaler.

cforce avatar cforce commented on September 25, 2024

Thanks for clarifications so far.
Am i right i only can use one " - external:" metric entry but as much additional " "-Resource" metrics
That would mean i can not use the "watermark" features from external metrics for different datadog metrics at the time in same hpa or how shall i fulfill requirement from 3.)

Is it a.) or b.) the another solution which works with externals from datadog for cpu and mem (or any other metric)

Are my above examples generally semantically correct?

from watermarkpodautoscaler.

CharlyF avatar CharlyF commented on September 25, 2024

You can use as many External or Resource entries and combination thereof as you wish.
So this is acceptable:

  - external:
    type: External
      highWatermark: 400m
      lowWatermark: 150m
      metricName: custom.request_duration.max
      metricSelector:
        matchLabels:
          kubernetes_cluster: mycluster
          service: billing
          short_image: billing-app
 - external:
    type: External
      highWatermark: 83
      lowWatermark: 21
      metricName: myothermetric.custom
      metricSelector:
        matchLabels:
          app: myapp
          release: 0.2.0
  - resource:
    type: Resource
      highWatermark: 300Mi
      lowWatermark: 50Mi
      name: memory
      metricSelector:
        matchLabels:
          app: nginx 

Is it a.) or b.) the another solution which works with externals from datadog for cpu and mem (or any other metric)

Not sure if I fully grasp what you mean, but what I will say is, you can use multiple External types in a single WPA and you can mix with Resource types too. Resource types require the /apis/metrics.k8s.io/ to be registered and serving (generally using the metrics server works out of the box) but you can find cpu or memory metrics that are collected by the Datadog Agents and therefore use External types to have the same value and as such, not need both the external metrics server (Datadog Cluster Agent) and the resource metrics server (metrics server), just the former.

I hope that answers your question.

Are my above examples generally semantically correct?

If you make sure to use a metric that exists in your Datadog account as an External type and also I think you would need to add

    type: External

in the external entry as above.
Then it should be okay.

from watermarkpodautoscaler.

CharlyF avatar CharlyF commented on September 25, 2024

Hi @cforce, I wanted to circle back on this.
Did my response help?

from watermarkpodautoscaler.

cforce avatar cforce commented on September 25, 2024

tx, it did

from watermarkpodautoscaler.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.