Otel collector created using otel operator not setting hpa memory utilization config correctly #3283
Description
Component(s)
collector
What happened?
Description
Otel collector created using otel operator not setting hpa memory utilization config correctly
Steps to Reproduce
Deploy otel operator.
Create otel collector deployment object with min of 3 replicas and max of 6 replicas
replicas : {{ .Values.minReplicaCount }}
resources:
limits:
cpu: 100m
memory: 1024Mi
# ephemeral-storage: 50Mi
requests:
cpu: 100m
memory: 64Mi
autoscaler:
minReplicas: {{ .Values.minReplicaCount }}
maxReplicas: {{ .Values.maxReplicaCount }}
targetCPUUtilization: 80
targetMemoryUtilization: 65
behavior:
scaleDown:
policies:
- periodSeconds: 600
type: Pods
value: 1
selectPolicy: Min
stabilizationWindowSeconds: 900
scaleUp:
policies:
- periodSeconds: 60
type: Pods
value: 2
- periodSeconds: 60
type: Percent
value: 100
selectPolicy: Max
stabilizationWindowSeconds: 60
The targetMemoryUtilization
is not honored and hpa always scale the collector pods although the memory utilization is less than 30 percent of the limit for each collector pods.
pod memory data -
NAME CPU(cores) MEMORY(bytes)
otel-gateway-collector-7898f79fdd-27l9j 1m 55Mi
hpa data -
otel-gateway-collector OpenTelemetryCollector/otel-gateway 112%/65%, 4%/80% 3 6 6 106m
Expected Result
Scaling should happen only based on targetMemoryUtilization
percentage.
Actual Result
Scaling happens since it calculates targetMemoryUtilization incorrectly.
Also please provide test cases for targetMemoryUtilization
in the repo. I don't find test cases for targetMemoryUtilization
in the repo https://github.com/open-telemetry/opentelemetry-operator/tree/main/tests/e2e-autoscale/autoscale
Kubernetes Version
1.29.7
Operator version
0.108.0
Collector version
0.109.0
Environment information
Environment
OS: (e.g., "Ubuntu 20.04")
Compiler(if manually compiled): (e.g., "go 14.2")
Log output
No response
Additional context
No response