Skip to content

Commit 3fa9ef2

Browse files
authored
Merge pull request #47 from lightstep/LS-54634-fix-kos
[LS-54634] Fix logic for HPAs
2 parents 5cd1f63 + c62c716 commit 3fa9ef2

File tree

6 files changed

+25
-16
lines changed

6 files changed

+25
-16
lines changed

.github/workflows/ci.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,8 @@ jobs:
6464

6565
- name: Run chart-testing kube-otel-state (install)
6666
if: steps.list-changed.outputs.changed == 'true'
67-
run: ct install --config ct.yaml --charts ./charts/kube-otel-stack --namespace opentelemetry --debug
67+
run: ct install --config ct.yaml --charts ./charts/kube-otel-stack --helm-extra-set-args="--set=tracesCollector.enabled=true --set=logsCollector.enabled=true" --namespace opentelemetry --debug
6868

6969
- name: Run chart-testing otel-cloud-stack (install)
7070
if: steps.list-changed.outputs.changed == 'true'
71-
run: ct install --config ct.yaml --charts ./charts/otel-cloud-stack --namespace opentelemetry --debug
71+
run: ct install --config ct.yaml --charts ./charts/otel-cloud-stack --helm-extra-set-args="--set=tracesCollector.enabled=true --set=logsCollector.enabled=true" --namespace opentelemetry --debug

charts/kube-otel-stack/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v2
22
name: kube-otel-stack
33
description: Chart for sending Kubernetes metrics to Lightstep using the OpenTelemetry Operator.
44
type: application
5-
version: 0.3.2
5+
version: 0.3.3
66
appVersion: 0.83.0
77
dependencies:
88
# cert manager must be manually installed because it has CRDs

charts/kube-otel-stack/templates/collector.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,17 @@ spec:
1616
mode: {{ $collector.mode }}
1717
image: {{ $collector.image }}
1818
replicas: {{ $collector.replicas | default 1 }}
19-
{{- if and $collector.hpa $collector.hpa.enabled }}
19+
{{- with $collector.hpa }}
20+
{{- if .enabled }}
2021
autoscaler:
21-
minReplicas: {{ $collector.hpa.minReplicas }}
22-
maxReplicas: {{ $collector.hpa.maxReplicas }}
23-
targetMemoryUtilization: {{ $collector.hpa.targetMemoryUtilization }}
24-
{{- if $collector.hpa.targetCPUUtilization }}
25-
targetCPUUtilization: {{ $collector.hpa.targetCPUUtilization }}
22+
minReplicas: {{ .minReplicas }}
23+
maxReplicas: {{ .maxReplicas }}
24+
targetMemoryUtilization: {{ .targetMemoryUtilization }}
25+
{{- if .targetCPUUtilization }}
26+
targetCPUUtilization: {{ .targetCPUUtilization }}
2627
{{- end }}
2728
{{- end }}
29+
{{- end }}
2830
{{- with $collector.podAnnotations }}
2931
podAnnotations:
3032
{{- toYaml . | nindent 4}}

charts/kube-otel-stack/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ tracesCollector:
5151
image: otel/opentelemetry-collector-contrib:0.83.0
5252
mode: deployment
5353
replicas: 1
54+
hpa:
55+
enabled: false
56+
minReplicas: 3
57+
maxReplicas: 10
58+
targetMemoryUtilization: 70
5459
resources:
5560
limits:
5661
cpu: 250m

charts/otel-cloud-stack/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ type: application
1515
# This is the chart version. This version number should be incremented each time you make changes
1616
# to the chart and its templates, including the app version.
1717
# Versions are expected to follow Semantic Versioning (https://semver.org/)
18-
version: "0.2.4"
18+
version: "0.2.5"
1919

2020
# This is the version number of the application being deployed. This version number should be
2121
# incremented each time you make changes to the application. Versions are not expected to

charts/otel-cloud-stack/templates/collector.yaml

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,17 @@ spec:
2727
{{- if not (eq $collector.mode "daemonset") }}
2828
replicas: {{ $collector.replicas | default 1 }}
2929
{{- end }}
30-
{{- if $collector.hpa }}
30+
{{- with $collector.hpa }}
31+
{{- if .enabled }}
3132
autoscaler:
32-
minReplicas: {{ $collector.hpa.minReplicas }}
33-
maxReplicas: {{ $collector.hpa.maxReplicas }}
34-
targetMemoryUtilization: {{ $collector.hpa.targetMemoryUtilization }}
35-
{{- if $collector.hpa.targetCPUUtilization }}
36-
targetCPUUtilization: {{ $collector.hpa.targetCPUUtilization }}
33+
minReplicas: {{ .minReplicas }}
34+
maxReplicas: {{ .maxReplicas }}
35+
targetMemoryUtilization: {{ .targetMemoryUtilization }}
36+
{{- if .targetCPUUtilization }}
37+
targetCPUUtilization: {{ .targetCPUUtilization }}
3738
{{- end }}
3839
{{- end }}
40+
{{- end }}
3941
{{- with $collector.podAnnotations }}
4042
podAnnotations:
4143
{{- toYaml . | nindent 4}}

0 commit comments

Comments
 (0)