Scale to zero refuses to work #2050
-
ReportCan somebody tell me what the heck am I doing wrong? I just tried the same with KEDA 2.3.0 to make sure it isn't a 2.4.0 bug but still not working, so seems like this is my fault. In this example, I'm trying with a StatefulSet but I already tried with Deployment and nothing different happens. This is my ScaleObject YAML apiVersion: keda.sh/v1alpha1
kind: ScaledObject
metadata:
name: arim
namespace: enonic-review
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: StatefulSet
name: arim
pollingInterval: 10
cooldownPeriod: 15
minReplicaCount: 0
maxReplicaCount: 1
triggers:
- type: prometheus
metadata:
serverAddress: http://prometheus.lens-metrics.svc.cluster.local
metricName: container_network_receive_packets_total
query: sum(rate(container_network_transmit_packets_total{namespace='enonic-review',pod_name=~"arim-.*"}[1m])) * 10
threshold: '10' Already tried with idleReplicaCount: 0
minReplicaCount: 1
maxReplicaCount: 1 and maxReplicaCount: 1 As you can see on HPA watch logs, it must be scaled to zero a few seconds after my HPA target goes to less than 10 (which is my Prometheus trigger threshold), but absolutely nothing happens.
Logs from KEDA operatorThe operator logs keep repeating those following entries forever like nothing different happens
KEDA Version2.4.0 Kubernetes Version1.21 PlatformAmazon Web Services Scaler DetailsPrometheus |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
[SOLVED] Turns out that KEDA only scales to zero when the target is exactly zero, I thought that it could scale if the target was above the threshold. I think it can be more clarified on documentation but that's ok, after I figured it out my ScaledObject worked like a charm. |
Beta Was this translation helpful? Give feedback.
[SOLVED] Turns out that KEDA only scales to zero when the target is exactly zero, I thought that it could scale if the target was above the threshold. I think it can be more clarified on documentation but that's ok, after I figured it out my ScaledObject worked like a charm.