File tree Expand file tree Collapse file tree 6 files changed +65
-0
lines changed Expand file tree Collapse file tree 6 files changed +65
-0
lines changed Original file line number Diff line number Diff line change 2
2
3
3
## master / unreleased
4
4
5
+ * [ FEATURE] Add autoscaler for distributors #189
5
6
* [ FEATURE] Add autoscaler for ingesters #182
6
7
* [ ENHANCEMENT] Define namespace in templates #184
7
8
* [ ENHANCEMENT] Use FQDN for memcached addresses #175
Original file line number Diff line number Diff line change @@ -413,6 +413,12 @@ Kubernetes: `^1.19.0-0`
413
413
| distributor.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].podAffinityTerm.topologyKey | string | `"kubernetes.io/hostname"` | |
414
414
| distributor.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].weight | int | `100` | |
415
415
| distributor.annotations | object | `{}` | |
416
+ | distributor.autoscaling.behavior | object | `{}` | Ref : https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-configurable-scaling-behavior |
417
+ | distributor.autoscaling.enabled | bool | `false` | Creates a HorizontalPodAutoscaler for the distributor pods. |
418
+ | distributor.autoscaling.maxReplicas | int | `30` | |
419
+ | distributor.autoscaling.minReplicas | int | `2` | |
420
+ | distributor.autoscaling.targetCPUUtilizationPercentage | int | `80` | |
421
+ | distributor.autoscaling.targetMemoryUtilizationPercentage | int | `0` | |
416
422
| distributor.containerSecurityContext.enabled | bool | `true` | |
417
423
| distributor.containerSecurityContext.readOnlyRootFilesystem | bool | `true` | |
418
424
| distributor.env | list | `[]` | |
Original file line number Diff line number Diff line change @@ -57,9 +57,15 @@ config:
57
57
58
58
ingester :
59
59
replicas : 1
60
+ autoscaling :
61
+ enabled : true
62
+ minReplicas : 1
60
63
statefulSet :
61
64
enabled : true
62
65
distributor :
63
66
replicas : 1
67
+ autoscaling :
68
+ enabled : true
69
+ minReplicas : 1
64
70
nginx :
65
71
replicas : 1
Original file line number Diff line number Diff line change @@ -9,7 +9,9 @@ metadata:
9
9
annotations :
10
10
{{- toYaml .Values.distributor.annotations | nindent 4 }}
11
11
spec :
12
+ {{- if not .Values.distributor.autoscaling.enabled }}
12
13
replicas : {{ .Values.distributor.replicas }}
14
+ {{- end }}
13
15
selector :
14
16
matchLabels :
15
17
{{- include "cortex.distributorSelectorLabels" . | nindent 6 }}
Original file line number Diff line number Diff line change
1
+ {{- with .Values.distributor.autoscaling -}}
2
+ {{- if .enabled }}
3
+ apiVersion : autoscaling/v2beta2
4
+ kind : HorizontalPodAutoscaler
5
+ metadata :
6
+ name : {{ include "cortex.distributorFullname" $ }}
7
+ namespace : {{ $.Release.Namespace }}
8
+ labels :
9
+ {{- include "cortex.distributorLabels" $ | nindent 4 }}
10
+ spec :
11
+ scaleTargetRef :
12
+ apiVersion : apps/v1
13
+ kind : Deployment
14
+ name : {{ include "cortex.distributorFullname" $ }}
15
+ minReplicas : {{ .minReplicas }}
16
+ maxReplicas : {{ .maxReplicas }}
17
+ metrics :
18
+ {{- with .targetCPUUtilizationPercentage }}
19
+ - type : Resource
20
+ resource :
21
+ name : cpu
22
+ target :
23
+ type : Utilization
24
+ averageUtilization : {{ . }}
25
+ {{- end }}
26
+ {{- with .targetMemoryUtilizationPercentage }}
27
+ - type : Resource
28
+ resource :
29
+ name : memory
30
+ target :
31
+ type : Utilization
32
+ averageUtilization : {{ . }}
33
+ {{- end }}
34
+ {{- with .behavior }}
35
+ behavior :
36
+ {{- toYaml . | nindent 4 }}
37
+ {{- end }}
38
+ {{- end }}
39
+ {{- end }}
Original file line number Diff line number Diff line change @@ -422,6 +422,17 @@ distributor:
422
422
topologyKey : ' kubernetes.io/hostname'
423
423
424
424
annotations : {}
425
+
426
+ autoscaling :
427
+ # -- Creates a HorizontalPodAutoscaler for the distributor pods.
428
+ enabled : false
429
+ minReplicas : 2
430
+ maxReplicas : 30
431
+ targetCPUUtilizationPercentage : 80
432
+ targetMemoryUtilizationPercentage : 0 # 80
433
+ # -- Ref: https://kubernetes.io/docs/tasks/run-application/horizontal-pod-autoscale/#support-for-configurable-scaling-behavior
434
+ behavior : {}
435
+
425
436
persistence :
426
437
subPath :
427
438
You can’t perform that action at this time.
0 commit comments