Skip to content

Commit 55f95e3

Browse files
feat(helm): allow configuration of service trafficDistribution parameter (#19558)
Co-authored-by: J Stickler <[email protected]>
1 parent e916944 commit 55f95e3

File tree

13 files changed

+169
-11
lines changed

13 files changed

+169
-11
lines changed

docs/sources/setup/install/helm/reference.md

Lines changed: 112 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -414,6 +414,7 @@ This is the generated reference for the Loki Helm Chart values.
414414
"service": {
415415
"annotations": {},
416416
"labels": {},
417+
"trafficDistribution": "",
417418
"type": "ClusterIP"
418419
},
419420
"targetModule": "backend",
@@ -777,6 +778,15 @@ null
777778
<td><pre lang="json">
778779
{}
779780
</pre>
781+
</td>
782+
</tr>
783+
<tr>
784+
<td>backend.service.trafficDistribution</td>
785+
<td>string</td>
786+
<td>trafficDistribution for backend Service</td>
787+
<td><pre lang="json">
788+
""
789+
</pre>
780790
</td>
781791
</tr>
782792
<tr>
@@ -5251,6 +5261,15 @@ null
52515261
<td><pre lang="json">
52525262
80
52535263
</pre>
5264+
</td>
5265+
</tr>
5266+
<tr>
5267+
<td>gateway.service.trafficDistribution</td>
5268+
<td>string</td>
5269+
<td>trafficDistribution for gateway service</td>
5270+
<td><pre lang="json">
5271+
""
5272+
</pre>
52545273
</td>
52555274
</tr>
52565275
<tr>
@@ -5484,6 +5503,7 @@ null
54845503
"terminationGracePeriodSeconds": 300,
54855504
"tolerations": [],
54865505
"topologySpreadConstraints": [],
5506+
"trafficDistribution": "",
54875507
"updateStrategy": {
54885508
"type": "RollingUpdate"
54895509
}
@@ -5835,6 +5855,15 @@ null
58355855
<td><pre lang="json">
58365856
[]
58375857
</pre>
5858+
</td>
5859+
</tr>
5860+
<tr>
5861+
<td>indexGateway.trafficDistribution</td>
5862+
<td>string</td>
5863+
<td>trafficDistribution for index-gateway service</td>
5864+
<td><pre lang="json">
5865+
""
5866+
</pre>
58385867
</td>
58395868
</tr>
58405869
<tr>
@@ -5960,6 +5989,7 @@ null
59605989
"whenUnsatisfiable": "ScheduleAnyway"
59615990
}
59625991
],
5992+
"trafficDistribution": "",
59635993
"updateStrategy": {
59645994
"type": "RollingUpdate"
59655995
},
@@ -6362,7 +6392,7 @@ false
63626392
<tr>
63636393
<td>ingester.serviceAnnotations</td>
63646394
<td>object</td>
6365-
<td>Annotations for ingestor service</td>
6395+
<td>Annotations for ingester service</td>
63666396
<td><pre lang="json">
63676397
{}
63686398
</pre>
@@ -6371,7 +6401,7 @@ false
63716401
<tr>
63726402
<td>ingester.serviceLabels</td>
63736403
<td>object</td>
6374-
<td>Labels for ingestor service</td>
6404+
<td>Labels for ingester service</td>
63756405
<td><pre lang="json">
63766406
{}
63776407
</pre>
@@ -6380,7 +6410,7 @@ false
63806410
<tr>
63816411
<td>ingester.serviceType</td>
63826412
<td>string</td>
6383-
<td>Service type for ingestor service</td>
6413+
<td>Service type for ingester service</td>
63846414
<td><pre lang="json">
63856415
"ClusterIP"
63866416
</pre>
@@ -6411,6 +6441,15 @@ false
64116441
<td><pre lang="">
64126442
Defaults to allow skew no more than 1 node
64136443
</pre>
6444+
</td>
6445+
</tr>
6446+
<tr>
6447+
<td>ingester.trafficDistribution</td>
6448+
<td>string</td>
6449+
<td>trafficDistribution for ingester service</td>
6450+
<td><pre lang="json">
6451+
""
6452+
</pre>
64146453
</td>
64156454
</tr>
64166455
<tr>
@@ -7174,6 +7213,15 @@ null
71747213
"http_server_write_timeout": "600s"
71757214
}
71767215
</pre>
7216+
</td>
7217+
</tr>
7218+
<tr>
7219+
<td>loki.service.trafficDistribution</td>
7220+
<td>string</td>
7221+
<td>trafficDistribution for services Ref: https://kubernetes.io/docs/concepts/services-networking/service/#traffic-distribution</td>
7222+
<td><pre lang="json">
7223+
""
7224+
</pre>
71777225
</td>
71787226
</tr>
71797227
<tr>
@@ -9729,7 +9777,8 @@ null
97299777
"topologyKey": "kubernetes.io/hostname",
97309778
"whenUnsatisfiable": "ScheduleAnyway"
97319779
}
9732-
]
9780+
],
9781+
"trafficDistribution": ""
97339782
}
97349783
</pre>
97359784
</td>
@@ -10094,6 +10143,15 @@ null
1009410143
<td><pre lang="">
1009510144
Defaults to allow skew no more then 1 node
1009610145
</pre>
10146+
</td>
10147+
</tr>
10148+
<tr>
10149+
<td>querier.trafficDistribution</td>
10150+
<td>string</td>
10151+
<td>trafficDistribution for querier service</td>
10152+
<td><pre lang="json">
10153+
""
10154+
</pre>
1009710155
</td>
1009810156
</tr>
1009910157
<tr>
@@ -10164,7 +10222,8 @@ Defaults to allow skew no more then 1 node
1016410222
"serviceType": "ClusterIP",
1016510223
"terminationGracePeriodSeconds": 30,
1016610224
"tolerations": [],
10167-
"topologySpreadConstraints": []
10225+
"topologySpreadConstraints": [],
10226+
"trafficDistribution": ""
1016810227
}
1016910228
</pre>
1017010229
</td>
@@ -10522,6 +10581,15 @@ null
1052210581
<td><pre lang="json">
1052310582
[]
1052410583
</pre>
10584+
</td>
10585+
</tr>
10586+
<tr>
10587+
<td>queryFrontend.trafficDistribution</td>
10588+
<td>string</td>
10589+
<td>trafficDistribution for query-frontend service</td>
10590+
<td><pre lang="json">
10591+
""
10592+
</pre>
1052510593
</td>
1052610594
</tr>
1052710595
<tr>
@@ -10575,7 +10643,8 @@ null
1057510643
"serviceLabels": {},
1057610644
"terminationGracePeriodSeconds": 30,
1057710645
"tolerations": [],
10578-
"topologySpreadConstraints": []
10646+
"topologySpreadConstraints": [],
10647+
"trafficDistribution": ""
1057910648
}
1058010649
</pre>
1058110650
</td>
@@ -10823,6 +10892,15 @@ null
1082310892
<td><pre lang="json">
1082410893
[]
1082510894
</pre>
10895+
</td>
10896+
</tr>
10897+
<tr>
10898+
<td>queryScheduler.trafficDistribution</td>
10899+
<td>string</td>
10900+
<td>trafficDistribution for query-scheduler service</td>
10901+
<td><pre lang="json">
10902+
""
10903+
</pre>
1082610904
</td>
1082710905
</tr>
1082810906
<tr>
@@ -10940,6 +11018,7 @@ false
1094011018
"service": {
1094111019
"annotations": {},
1094211020
"labels": {},
11021+
"trafficDistribution": "",
1094311022
"type": "ClusterIP"
1094411023
},
1094511024
"targetModule": "read",
@@ -11329,6 +11408,15 @@ null
1132911408
<td><pre lang="json">
1133011409
{}
1133111410
</pre>
11411+
</td>
11412+
</tr>
11413+
<tr>
11414+
<td>read.service.trafficDistribution</td>
11415+
<td>string</td>
11416+
<td>trafficDistribution for read service</td>
11417+
<td><pre lang="json">
11418+
""
11419+
</pre>
1133211420
</td>
1133311421
</tr>
1133411422
<tr>
@@ -12820,6 +12908,15 @@ null
1282012908
<td><pre lang="json">
1282112909
{}
1282212910
</pre>
12911+
</td>
12912+
</tr>
12913+
<tr>
12914+
<td>singleBinary.service.trafficDistribution</td>
12915+
<td>string</td>
12916+
<td>trafficDistribution single binary Service</td>
12917+
<td><pre lang="json">
12918+
""
12919+
</pre>
1282312920
</td>
1282412921
</tr>
1282512922
<tr>
@@ -13702,6 +13799,15 @@ null
1370213799
<td><pre lang="json">
1370313800
{}
1370413801
</pre>
13802+
</td>
13803+
</tr>
13804+
<tr>
13805+
<td>write.service.trafficDistribution</td>
13806+
<td>string</td>
13807+
<td>trafficDistribution for write service</td>
13808+
<td><pre lang="json">
13809+
""
13810+
</pre>
1370513811
</td>
1370613812
</tr>
1370713813
<tr>

production/helm/loki/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Entries should include a reference to the pull request that introduced the chang
4646
- [CHANGE] Changed version of Grafana Loki to 3.5.7.
4747
- [FEATURE] Allow auto-resizing the volume by recreating the StatefulSet. [#19217](https://github.com/grafana/loki/pull/19217).
4848
- [BUGFIX] Add single-binary component to the podSelector. [#19229](https://github.com/grafana/loki/pull/19229).
49+
- [ENHANCEMENT] Added `trafficDistribution` configuration option to backend, compactor, distributor, gateway, index-gateway, ingester, querier, query-frontend, query-scheduler,read and write services to enable same-zone traffic routing. #19557
4950

5051
## 6.43.0
5152

production/helm/loki/templates/backend/service-backend.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,4 +34,7 @@ spec:
3434
protocol: TCP
3535
selector:
3636
{{- include "loki.backendSelectorLabels" . | nindent 4 }}
37+
{{- with .Values.backend.service.trafficDistribution | default .Values.loki.service.trafficDistribution }}
38+
trafficDistribution: {{ . }}
39+
{{- end }}
3740
{{- end }}

production/helm/loki/templates/distributor/service-distributor.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ spec:
3333
{{- end }}
3434
selector:
3535
{{- include "loki.distributorSelectorLabels" . | nindent 4 }}
36-
{{- if .Values.distributor.trafficDistribution }}
37-
trafficDistribution: {{ .Values.distributor.trafficDistribution }}
36+
{{- with .Values.distributor.trafficDistribution | default .Values.loki.service.trafficDistribution }}
37+
trafficDistribution: {{ . }}
3838
{{- end }}
3939
{{- end -}}

production/helm/loki/templates/gateway/service-gateway.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,4 +40,7 @@ spec:
4040
protocol: TCP
4141
selector:
4242
{{- include "loki.gatewaySelectorLabels" . | nindent 4 }}
43+
{{- with .Values.gateway.service.trafficDistribution | default .Values.loki.service.trafficDistribution }}
44+
trafficDistribution: {{ . }}
45+
{{- end }}
4346
{{- end }}

production/helm/loki/templates/index-gateway/service-index-gateway.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,7 @@ spec:
3333
{{- end }}
3434
selector:
3535
{{- include "loki.indexGatewaySelectorLabels" . | nindent 4 }}
36+
{{- with .Values.indexGateway.trafficDistribution | default .Values.loki.service.trafficDistribution }}
37+
trafficDistribution: {{ . }}
38+
{{- end }}
3639
{{- end }}

production/helm/loki/templates/ingester/service-ingester.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,7 @@ spec:
3333
{{- end }}
3434
selector:
3535
{{- include "loki.ingesterSelectorLabels" . | nindent 4 }}
36+
{{- with .Values.ingester.trafficDistribution | default .Values.loki.service.trafficDistribution }}
37+
trafficDistribution: {{ . }}
38+
{{- end }}
3639
{{- end -}}

production/helm/loki/templates/querier/service-querier.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,4 +33,7 @@ spec:
3333
{{- end }}
3434
selector:
3535
{{- include "loki.querierSelectorLabels" . | nindent 4 }}
36+
{{- with .Values.querier.trafficDistribution | default .Values.loki.service.trafficDistribution }}
37+
trafficDistribution: {{ . }}
38+
{{- end }}
3639
{{- end -}}

production/helm/loki/templates/query-frontend/service-query-frontend.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,4 +43,7 @@ spec:
4343
{{- end }}
4444
selector:
4545
{{- include "loki.queryFrontendSelectorLabels" . | nindent 4 }}
46+
{{- with .Values.queryFrontend.trafficDistribution | default .Values.loki.service.trafficDistribution }}
47+
trafficDistribution: {{ . }}
48+
{{- end }}
4649
{{- end -}}

production/helm/loki/templates/query-scheduler/service-query-scheduler.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,7 @@ spec:
3535
{{- end }}
3636
selector:
3737
{{- include "loki.querySchedulerSelectorLabels" . | nindent 4 }}
38+
{{- with .Values.queryScheduler.trafficDistribution | default .Values.loki.service.trafficDistribution }}
39+
trafficDistribution: {{ . }}
40+
{{- end }}
3841
{{- end }}

0 commit comments

Comments
 (0)