Comments (5)
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.
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.
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.
Hi @cforce, I wanted to circle back on this.
Did my response help?
from watermarkpodautoscaler.
tx, it did
from watermarkpodautoscaler.
Related Issues (20)
- documentation: quantities and metric relation, case sensitiveness, metric context/selection HOT 2
- unable to fetch metrics from external metrics API: Internal error occurred: DatadogMetric is invalid, err: Invalid metric (from backend) HOT 3
- docs: external_metrics vs custometric HOT 5
- Change dryRun value using helm chart HOT 3
- Get a wpa based on CPU/Memory resource does not show values HOT 1
- Kubernetes 1.22 compatibility HOT 5
- Resource type WPA metrics do not appear to be averaging correctly HOT 4
- Question: What does "only officially supports one metric per WPA" mean?
- WPA doesn't build on M1 HOT 1
- Constant errors HOT 2
- WPA support for openshift 3.11 + k8s 1.11 HOT 17
- Publish to a Helm Chart repository HOT 4
- WPA controller was unable to update the number of replicas: status.currentMetrics in body must be of type array: "null" HOT 4
- WPA will get panic if we try to scale Openshift DeploymentConfig HOT 10
- Standby pods are panicking HOT 1
- host images in docker hub HOT 4
- watermarkpodautoscaler": executable file not found in $PATH: unknown HOT 3
- crash loop - flag provided but not defined: -zap-level HOT 5
- shema watermarkpodautoscaler-datadoghq-v1alpha1.json not found HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from watermarkpodautoscaler.