Skip to content

Commit 31d3816

Browse files
committed
feat: allow configuration of service trafficDistribution parameter
Fixes: #19557
1 parent 1605a38 commit 31d3816

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>
@@ -7173,6 +7212,15 @@ null
71737212
"http_server_write_timeout": "600s"
71747213
}
71757214
</pre>
7215+
</td>
7216+
</tr>
7217+
<tr>
7218+
<td>loki.service.trafficDistribution</td>
7219+
<td>string</td>
7220+
<td>trafficDistribution for services Ref: https://kubernetes.io/docs/concepts/services-networking/service/#traffic-distribution</td>
7221+
<td><pre lang="json">
7222+
""
7223+
</pre>
71767224
</td>
71777225
</tr>
71787226
<tr>
@@ -9728,7 +9776,8 @@ null
97289776
"topologyKey": "kubernetes.io/hostname",
97299777
"whenUnsatisfiable": "ScheduleAnyway"
97309778
}
9731-
]
9779+
],
9780+
"trafficDistribution": ""
97329781
}
97339782
</pre>
97349783
</td>
@@ -10093,6 +10142,15 @@ null
1009310142
<td><pre lang="">
1009410143
Defaults to allow skew no more then 1 node
1009510144
</pre>
10145+
</td>
10146+
</tr>
10147+
<tr>
10148+
<td>querier.trafficDistribution</td>
10149+
<td>string</td>
10150+
<td>trafficDistribution for querier service</td>
10151+
<td><pre lang="json">
10152+
""
10153+
</pre>
1009610154
</td>
1009710155
</tr>
1009810156
<tr>
@@ -10163,7 +10221,8 @@ Defaults to allow skew no more then 1 node
1016310221
"serviceType": "ClusterIP",
1016410222
"terminationGracePeriodSeconds": 30,
1016510223
"tolerations": [],
10166-
"topologySpreadConstraints": []
10224+
"topologySpreadConstraints": [],
10225+
"trafficDistribution": ""
1016710226
}
1016810227
</pre>
1016910228
</td>
@@ -10521,6 +10580,15 @@ null
1052110580
<td><pre lang="json">
1052210581
[]
1052310582
</pre>
10583+
</td>
10584+
</tr>
10585+
<tr>
10586+
<td>queryFrontend.trafficDistribution</td>
10587+
<td>string</td>
10588+
<td>trafficDistribution for query-frontend service</td>
10589+
<td><pre lang="json">
10590+
""
10591+
</pre>
1052410592
</td>
1052510593
</tr>
1052610594
<tr>
@@ -10574,7 +10642,8 @@ null
1057410642
"serviceLabels": {},
1057510643
"terminationGracePeriodSeconds": 30,
1057610644
"tolerations": [],
10577-
"topologySpreadConstraints": []
10645+
"topologySpreadConstraints": [],
10646+
"trafficDistribution": ""
1057810647
}
1057910648
</pre>
1058010649
</td>
@@ -10822,6 +10891,15 @@ null
1082210891
<td><pre lang="json">
1082310892
[]
1082410893
</pre>
10894+
</td>
10895+
</tr>
10896+
<tr>
10897+
<td>queryScheduler.trafficDistribution</td>
10898+
<td>string</td>
10899+
<td>trafficDistribution for query-scheduler service</td>
10900+
<td><pre lang="json">
10901+
""
10902+
</pre>
1082510903
</td>
1082610904
</tr>
1082710905
<tr>
@@ -10939,6 +11017,7 @@ false
1093911017
"service": {
1094011018
"annotations": {},
1094111019
"labels": {},
11020+
"trafficDistribution": "",
1094211021
"type": "ClusterIP"
1094311022
},
1094411023
"targetModule": "read",
@@ -11328,6 +11407,15 @@ null
1132811407
<td><pre lang="json">
1132911408
{}
1133011409
</pre>
11410+
</td>
11411+
</tr>
11412+
<tr>
11413+
<td>read.service.trafficDistribution</td>
11414+
<td>string</td>
11415+
<td>trafficDistribution for read service</td>
11416+
<td><pre lang="json">
11417+
""
11418+
</pre>
1133111419
</td>
1133211420
</tr>
1133311421
<tr>
@@ -12819,6 +12907,15 @@ null
1281912907
<td><pre lang="json">
1282012908
{}
1282112909
</pre>
12910+
</td>
12911+
</tr>
12912+
<tr>
12913+
<td>singleBinary.service.trafficDistribution</td>
12914+
<td>string</td>
12915+
<td>trafficDistribution single binary Service</td>
12916+
<td><pre lang="json">
12917+
""
12918+
</pre>
1282212919
</td>
1282312920
</tr>
1282412921
<tr>
@@ -13701,6 +13798,15 @@ null
1370113798
<td><pre lang="json">
1370213799
{}
1370313800
</pre>
13801+
</td>
13802+
</tr>
13803+
<tr>
13804+
<td>write.service.trafficDistribution</td>
13805+
<td>string</td>
13806+
<td>trafficDistribution for write service</td>
13807+
<td><pre lang="json">
13808+
""
13809+
</pre>
1370413810
</td>
1370513811
</tr>
1370613812
<tr>

production/helm/loki/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ Entries should include a reference to the pull request that introduced the chang
4545
- [CHANGE] Changed version of Grafana Loki to 3.5.7.
4646
- [FEATURE] Allow auto-resizing the volume by recreating the StatefulSet. [#19217](https://github.com/grafana/loki/pull/19217).
4747
- [BUGFIX] Add single-binary component to the podSelector. [#19229](https://github.com/grafana/loki/pull/19229).
48+
- [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
4849

4950
## 6.43.0
5051

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)