Skip to content

Commit 04b8ca0

Browse files
feat(HPA): Adds autoscaling config
OSC-1200 - Disabled by default for now. - Tests to be followed. Signed-off-by: Dhruv Shah <dhruv.shah@sumologic.com>
1 parent cac352c commit 04b8ca0

File tree

2 files changed

+49
-1
lines changed

2 files changed

+49
-1
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{{- if .Values.sumologic.autoscaling.enabled }}
2+
apiVersion: autoscaling/v2
3+
kind: HorizontalPodAutoscaler
4+
metadata:
5+
name: {{ template "sumologic.metadata.name.logs.configmap" . }}
6+
namespace: {{ template "sumologic.namespace" . }}
7+
labels:
8+
app: {{ template "sumologic.labels.app.logs.configmap" . }}
9+
{{- include "sumologic.labels.common" . | nindent 4 }}
10+
spec:
11+
scaleTargetRef:
12+
apiVersion: apps/v1
13+
kind: Statefulset
14+
name: {{ template "sumologic.metadata.name.logs.service-headless" . }}
15+
minReplicas: {{ .Values.sumologic.autoscaling.minReplicas }}
16+
maxReplicas: {{ .Values.sumologic.autoscaling.maxReplicas }}
17+
{{- if .Values.sumologic.autoscaling.behavior }}
18+
behavior:
19+
{{- toYaml .Values.sumologic.autoscaling.behavior | nindent 4 }}
20+
{{- end }}
21+
metrics:
22+
{{- if .Values.sumologic.autoscaling.targetMemoryUtilizationPercentage }}
23+
- type: Resource
24+
resource:
25+
name: memory
26+
target:
27+
type: Utilization
28+
averageUtilization: {{ .Values.sumologic.autoscaling.targetMemoryUtilizationPercentage }}
29+
{{- end }}
30+
{{- if .Values.sumologic.autoscaling.targetCPUUtilizationPercentage }}
31+
- type: Resource
32+
resource:
33+
name: cpu
34+
target:
35+
type: Utilization
36+
averageUtilization: {{ .Values.sumologic.autoscaling.targetCPUUtilizationPercentage }}
37+
{{- end }}
38+
{{- with .Values.sumologic.autoscaling.additionalMetrics }}
39+
{{- toYaml . | nindent 4 }}
40+
{{- end }}
41+
{{- end }}

deploy/helm/sumologic/values.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,14 @@ sumologic:
7474

7575
## Enable autoscaling for components that support it: logs metadata, metrics metadata, metrics collector, otelcol instrumentation, and traces gateway
7676
autoscaling:
77-
enabled: true
77+
enabled: false
78+
minReplicas: 1
79+
maxReplicas: 5
80+
targetCPUUtilizationPercentage: 80
81+
# targetMemoryUtilizationPercentage: 70
82+
behavior: {}
83+
additionalMetrics: []
84+
7885

7986
## If you set it to false, it would set EXCLUDE_NAMESPACE=<release-namespace>
8087
## and not add the Otelcol logs and Prometheus remotestorage metrics.

0 commit comments

Comments
 (0)