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 22
33## master / unreleased
44
5+ * [ FEATURE] Add autoscaler for distributors #189
56* [ FEATURE] Add autoscaler for ingesters #182
67* [ ENHANCEMENT] Define namespace in templates #184
78* [ 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`
413413| distributor.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].podAffinityTerm.topologyKey | string | `"kubernetes.io/hostname"` | |
414414| distributor.affinity.podAntiAffinity.preferredDuringSchedulingIgnoredDuringExecution[0].weight | int | `100` | |
415415| 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` | |
416422| distributor.containerSecurityContext.enabled | bool | `true` | |
417423| distributor.containerSecurityContext.readOnlyRootFilesystem | bool | `true` | |
418424| distributor.env | list | `[]` | |
Original file line number Diff line number Diff line change @@ -57,9 +57,15 @@ config:
5757
5858ingester :
5959 replicas : 1
60+ autoscaling :
61+ enabled : true
62+ minReplicas : 1
6063 statefulSet :
6164 enabled : true
6265distributor :
6366 replicas : 1
67+ autoscaling :
68+ enabled : true
69+ minReplicas : 1
6470nginx :
6571 replicas : 1
Original file line number Diff line number Diff line change @@ -9,7 +9,9 @@ metadata:
99 annotations :
1010 {{- toYaml .Values.distributor.annotations | nindent 4 }}
1111spec :
12+ {{- if not .Values.distributor.autoscaling.enabled }}
1213 replicas : {{ .Values.distributor.replicas }}
14+ {{- end }}
1315 selector :
1416 matchLabels :
1517 {{- 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:
422422 topologyKey : ' kubernetes.io/hostname'
423423
424424 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+
425436 persistence :
426437 subPath :
427438
You can’t perform that action at this time.
0 commit comments