Skip to content

Commit 3fa9e83

Browse files
committed
feature: add autoscaling
This adds autoscaling in the form of HPA so this is more usable in a production environment out-of-the-box. I borrowed the abstraction from nginx-ingress. Since we're doomed to templating with Helm, I chose this one since it seemed flexible and neat.
1 parent 23c986f commit 3fa9e83

5 files changed

Lines changed: 85 additions & 2 deletions

File tree

charts/lightstepsatellite/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 2.0.12
2+
3+
* Add autoscaling via HorizontalPodAutoscaler. Set autoscaling.enabled=true to use it.
4+
15
## 2.0.11
26

37
* Incremental performance improvements

charts/lightstepsatellite/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
apiVersion: v1
22
name: lightstep
3-
version: 2.0.11
3+
version: 2.0.12
44
appVersion: "2022-08-19_13-14-47Z"
55
description: Lightstep microsatellite to collect telemetry data.
66
home: https://lightstep.com/

charts/lightstepsatellite/README.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# lightstep
22

3-
![Version: 2.0.11](https://img.shields.io/badge/Version-2.0.11-informational?style=flat-square) ![AppVersion: 2022-08-19_13-14-47Z](https://img.shields.io/badge/AppVersion-2022--08--19_13--14--47Z-informational?style=flat-square)
3+
![Version: 2.0.12](https://img.shields.io/badge/Version-2.0.12-informational?style=flat-square) ![AppVersion: 2022-08-19_13-14-47Z](https://img.shields.io/badge/AppVersion-2022--08--19_13--14--47Z-informational?style=flat-square)
44

55
Lightstep microsatellite to collect telemetry data.
66

@@ -11,6 +11,13 @@ Lightstep microsatellite to collect telemetry data.
1111
| Key | Type | Default | Description |
1212
|-----|------|---------|-------------|
1313
| affinity | object | `{}` | |
14+
| autoscaling.behavior | object | `{}` | |
15+
| autoscaling.enabled | bool | `false` | |
16+
| autoscaling.maxReplicas | int | `25` | |
17+
| autoscaling.minReplicas | int | `1` | |
18+
| autoscaling.targetCPUUtilizationPercentage | int | `50` | |
19+
| autoscaling.targetMemoryUtilizationPercentage | int | `50` | |
20+
| autoscalingTemplate | list | `[]` | |
1421
| fullnameOverride | string | `""` | |
1522
| image.pullPolicy | string | `"IfNotPresent"` | |
1623
| image.repository | string | `"lightstep/microsatellite"` | |
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{{- if .Values.autoscaling.enabled -}}
2+
3+
apiVersion: autoscaling/v2beta2
4+
kind: HorizontalPodAutoscaler
5+
metadata:
6+
labels:
7+
{{- include "lightstep.labels" . | nindent 4 }}
8+
name: {{ include "lightstep.fullname" . }}
9+
namespace: {{ .Release.Namespace }}
10+
spec:
11+
scaleTargetRef:
12+
apiVersion: apps/v1
13+
kind: Deployment
14+
name: {{ include "lightstep.fullname" . }}
15+
minReplicas: {{ .Values.autoscaling.minReplicas }}
16+
maxReplicas: {{ .Values.autoscaling.maxReplicas }}
17+
metrics:
18+
{{- with .Values.autoscaling.targetMemoryUtilizationPercentage }}
19+
- type: Resource
20+
resource:
21+
name: memory
22+
target:
23+
type: Utilization
24+
averageUtilization: {{ . }}
25+
{{- end }}
26+
{{- with .Values.autoscaling.targetCPUUtilizationPercentage }}
27+
- type: Resource
28+
resource:
29+
name: cpu
30+
target:
31+
type: Utilization
32+
averageUtilization: {{ . }}
33+
{{- end }}
34+
{{- with .Values.autoscalingTemplate }}
35+
{{- toYaml . | nindent 2 }}
36+
{{- end }}
37+
{{- with .Values.autoscaling.behavior }}
38+
behavior:
39+
{{- toYaml . | nindent 4 }}
40+
{{- end }}
41+
{{- end }}

charts/lightstepsatellite/values.yaml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,3 +165,34 @@ statsd:
165165
requests:
166166
memory: 15M
167167
cpu: 1
168+
169+
autoscaling:
170+
enabled: false
171+
minReplicas: 1
172+
maxReplicas: 25
173+
targetCPUUtilizationPercentage: 50
174+
targetMemoryUtilizationPercentage: 50
175+
behavior: {}
176+
# scaleDown:
177+
# stabilizationWindowSeconds: 300
178+
# policies:
179+
# - type: Pods
180+
# value: 1
181+
# periodSeconds: 180
182+
# scaleUp:
183+
# stabilizationWindowSeconds: 300
184+
# policies:
185+
# - type: Pods
186+
# value: 2
187+
# periodSeconds: 60
188+
189+
autoscalingTemplate: []
190+
# Custom or additional autoscaling metrics
191+
# ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-custom-metrics
192+
# - type: Pods
193+
# pods:
194+
# metric:
195+
# name: my_app_requests_total
196+
# target:
197+
# type: AverageValue
198+
# averageValue: 10000m

0 commit comments

Comments
 (0)