k8s dependencies to v0.33.2
chore: upgrade tools versions to latest available
chore: update-generated
chore: update custom-metrics-apiserver to current master
chore: remove deprecated code
Signed-off-by: Jayapriya Pai <janantha@redhat.com>
In custom-metrics-apiserver v1.22.0, contexts were added to the metric
providers. We can benefit from that by propagating the context given to
the provider down to the requests.
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
When serving the resource metrics API, prometheus-adapter may return
negative values for pods/nodes memory and CPU usage. This happens
because Prometheus sees counter resets which results in Prometheus
interpolating data incorrectly to avoid the counter value going down.
To prevent that, we need to add some guards in prometheus-adapter to
replace the negative value by zero whenever it detects one.
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
The code that we are reusing from metrics-server to call
GetContainerMetrics and GetNodeMetrics requires that both functions
returns arrays of lengths of the number of pods/nodes given as
arguments. In some cases, prometheus-adapter was returning nil which
caused panics in metrics-server code.
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>
When set to false, no namespace label will be set by the adapter based on the namespace
portion of the url in the request path.
This allows individual consumers to set namespace independent of the source kubernetes resource.
---
Example:
Given an adapter config like this:
```
externalRules:
- seriesQuery: 'nsq_topic_depth'
resources:
namespaced: false
```
An HPA could target a different namespace by setting it in the selector:
```
- type: External
external:
metric:
name: nsq_topic_depth
selector:
labelSelector:
topic: my-topic
namespace: nsq
```
This is useful for scaling on metrics from services that run in a differnt namespace than the source resource.
When querying custom-metrics, the metric label selectors weren't
populated in the resulting values.
Signed-off-by: Damien Grisonnet <dgrisonn@redhat.com>