Skip to content

Commit 615ac0e

Browse files
naseemkullahk8s-ci-robot
authored andcommittedDec 5, 2019
Add autoscaler for collector (helm#19385)
Signed-off-by: Naseem <[email protected]>
1 parent 60e82d8 commit 615ac0e

File tree

5 files changed

+44
-1
lines changed

5 files changed

+44
-1
lines changed
 

‎incubator/jaeger/Chart.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v1
22
appVersion: 1.15.1
33
description: A Jaeger Helm chart for Kubernetes
44
name: jaeger
5-
version: 0.15.0
5+
version: 0.16.0
66
keywords:
77
- jaeger
88
- opentracing

‎incubator/jaeger/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,11 @@ The following table lists the configurable parameters of the Jaeger chart and th
208208
| `agent.service.zipkinThriftPort` | zipkin.thrift over compact thrift | `5775` |
209209
| `agent.useHostNetwork` | Enable hostNetwork for agents | `false` |
210210
| `agent.tolerations` | Node Tolerations | `[]` |
211+
| `collector.autoscaling.enabled` | Enable horizontal pod autoscaling | `false` |
212+
| `collector.autoscaling.minReplicas` | Minimum replicas | 2 |
213+
| `collector.autoscaling.maxReplicas` | Maximum replicas | 10 |
214+
| `collector.autoscaling.targetCPUUtilizationPercentage` | Target CPU utilization | 80 |
215+
| `collector.autoscaling.targetMemoryUtilizationPercentage` | Target memory utilization | `nil` |
211216
| `collector.cmdlineParams` | Additional command line parameters | `nil` |
212217
| `collector.podAnnotations` | Annotations for Collector pod | `nil` |
213218
| `collector.service.httpPort` | Client port for HTTP thrift | `14268` |

‎incubator/jaeger/templates/collector-deploy.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ metadata:
1414
{{ toYaml .Values.collector.annotations | indent 4 }}
1515
{{- end }}
1616
spec:
17+
{{- if not .Values.collector.autoscaling.enabled }}
1718
replicas: {{ .Values.collector.replicaCount }}
19+
{{- end }}
1820
selector:
1921
matchLabels:
2022
app.kubernetes.io/name: {{ include "jaeger.name" . }}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
{{- if .Values.collector.autoscaling.enabled }}
2+
apiVersion: autoscaling/v2beta1
3+
kind: HorizontalPodAutoscaler
4+
metadata:
5+
name: {{ template "jaeger.collector.name" . }}
6+
labels:
7+
app.kubernetes.io/name: {{ include "jaeger.name" . }}
8+
helm.sh/chart: {{ include "jaeger.chart" . }}
9+
app.kubernetes.io/component: collector
10+
app.kubernetes.io/managed-by: {{ .Release.Service }}
11+
app.kubernetes.io/instance: {{ .Release.Name }}
12+
spec:
13+
scaleTargetRef:
14+
apiVersion: apps/v1
15+
kind: Deployment
16+
name: {{ template "jaeger.collector.name" . }}
17+
minReplicas: {{ .Values.collector.autoscaling.minReplicas }}
18+
maxReplicas: {{ .Values.collector.autoscaling.maxReplicas }}
19+
metrics:
20+
- type: Resource
21+
resource:
22+
name: cpu
23+
targetAverageUtilization: {{ .Values.collector.autoscaling.targetCPUUtilizationPercentage | default 80 }}
24+
{{- if .Values.collector.autoscaling.targetMemoryUtilizationPercentage }}
25+
- type: Resource
26+
resource:
27+
name: memory
28+
targetAverageUtilization: {{ .Values.collector.autoscaling.targetMemoryUtilizationPercentage }}
29+
{{- end }}
30+
{{- end }}

‎incubator/jaeger/values.yaml

+6
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@ collector:
151151
dnsPolicy: ClusterFirst
152152
cmdlineParams: {}
153153
replicaCount: 1
154+
autoscaling:
155+
enabled: false
156+
minReplicas: 2
157+
maxReplicas: 10
158+
# targetCPUUtilizationPercentage: 80
159+
# targetMemoryUtilizationPercentage: 80
154160
service:
155161
annotations: {}
156162
# List of IP ranges that are allowed to access the load balancer (if supported)

0 commit comments

Comments
 (0)
Please sign in to comment.