Skip to content

Commit 5562a19

Browse files
committed
feat: allow configuration of service trafficDistribution parameter
Fixes: #19557
1 parent 2229243 commit 5562a19

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>
@@ -5483,6 +5502,7 @@ null
54835502
"terminationGracePeriodSeconds": 300,
54845503
"tolerations": [],
54855504
"topologySpreadConstraints": [],
5505+
"trafficDistribution": "",
54865506
"updateStrategy": {
54875507
"type": "RollingUpdate"
54885508
}
@@ -5825,6 +5845,15 @@ null
58255845
<td><pre lang="json">
58265846
[]
58275847
</pre>
5848+
</td>
5849+
</tr>
5850+
<tr>
5851+
<td>indexGateway.trafficDistribution</td>
5852+
<td>string</td>
5853+
<td>trafficDistribution for index-gateway service</td>
5854+
<td><pre lang="json">
5855+
""
5856+
</pre>
58285857
</td>
58295858
</tr>
58305859
<tr>
@@ -5950,6 +5979,7 @@ null
59505979
"whenUnsatisfiable": "ScheduleAnyway"
59515980
}
59525981
],
5982+
"trafficDistribution": "",
59535983
"updateStrategy": {
59545984
"type": "RollingUpdate"
59555985
},
@@ -6352,7 +6382,7 @@ false
63526382
<tr>
63536383
<td>ingester.serviceAnnotations</td>
63546384
<td>object</td>
6355-
<td>Annotations for ingestor service</td>
6385+
<td>Annotations for ingester service</td>
63566386
<td><pre lang="json">
63576387
{}
63586388
</pre>
@@ -6361,7 +6391,7 @@ false
63616391
<tr>
63626392
<td>ingester.serviceLabels</td>
63636393
<td>object</td>
6364-
<td>Labels for ingestor service</td>
6394+
<td>Labels for ingester service</td>
63656395
<td><pre lang="json">
63666396
{}
63676397
</pre>
@@ -6370,7 +6400,7 @@ false
63706400
<tr>
63716401
<td>ingester.serviceType</td>
63726402
<td>string</td>
6373-
<td>Service type for ingestor service</td>
6403+
<td>Service type for ingester service</td>
63746404
<td><pre lang="json">
63756405
"ClusterIP"
63766406
</pre>
@@ -6401,6 +6431,15 @@ false
64016431
<td><pre lang="">
64026432
Defaults to allow skew no more than 1 node
64036433
</pre>
6434+
</td>
6435+
</tr>
6436+
<tr>
6437+
<td>ingester.trafficDistribution</td>
6438+
<td>string</td>
6439+
<td>trafficDistribution for ingester service</td>
6440+
<td><pre lang="json">
6441+
""
6442+
</pre>
64046443
</td>
64056444
</tr>
64066445
<tr>
@@ -7163,6 +7202,15 @@ null
71637202
"http_server_write_timeout": "600s"
71647203
}
71657204
</pre>
7205+
</td>
7206+
</tr>
7207+
<tr>
7208+
<td>loki.service.trafficDistribution</td>
7209+
<td>string</td>
7210+
<td>trafficDistribution for services Ref: https://kubernetes.io/docs/concepts/services-networking/service/#traffic-distribution</td>
7211+
<td><pre lang="json">
7212+
""
7213+
</pre>
71667214
</td>
71677215
</tr>
71687216
<tr>
@@ -9702,7 +9750,8 @@ null
97029750
"topologyKey": "kubernetes.io/hostname",
97039751
"whenUnsatisfiable": "ScheduleAnyway"
97049752
}
9705-
]
9753+
],
9754+
"trafficDistribution": ""
97069755
}
97079756
</pre>
97089757
</td>
@@ -10067,6 +10116,15 @@ null
1006710116
<td><pre lang="">
1006810117
Defaults to allow skew no more then 1 node
1006910118
</pre>
10119+
</td>
10120+
</tr>
10121+
<tr>
10122+
<td>querier.trafficDistribution</td>
10123+
<td>string</td>
10124+
<td>trafficDistribution for querier service</td>
10125+
<td><pre lang="json">
10126+
""
10127+
</pre>
1007010128
</td>
1007110129
</tr>
1007210130
<tr>
@@ -10134,7 +10192,8 @@ Defaults to allow skew no more then 1 node
1013410192
"serviceType": "ClusterIP",
1013510193
"terminationGracePeriodSeconds": 30,
1013610194
"tolerations": [],
10137-
"topologySpreadConstraints": []
10195+
"topologySpreadConstraints": [],
10196+
"trafficDistribution": ""
1013810197
}
1013910198
</pre>
1014010199
</td>
@@ -10481,6 +10540,15 @@ null
1048110540
<td><pre lang="json">
1048210541
[]
1048310542
</pre>
10543+
</td>
10544+
</tr>
10545+
<tr>
10546+
<td>queryFrontend.trafficDistribution</td>
10547+
<td>string</td>
10548+
<td>trafficDistribution for query-frontend service</td>
10549+
<td><pre lang="json">
10550+
""
10551+
</pre>
1048410552
</td>
1048510553
</tr>
1048610554
<tr>
@@ -10534,7 +10602,8 @@ null
1053410602
"serviceLabels": {},
1053510603
"terminationGracePeriodSeconds": 30,
1053610604
"tolerations": [],
10537-
"topologySpreadConstraints": []
10605+
"topologySpreadConstraints": [],
10606+
"trafficDistribution": ""
1053810607
}
1053910608
</pre>
1054010609
</td>
@@ -10782,6 +10851,15 @@ null
1078210851
<td><pre lang="json">
1078310852
[]
1078410853
</pre>
10854+
</td>
10855+
</tr>
10856+
<tr>
10857+
<td>queryScheduler.trafficDistribution</td>
10858+
<td>string</td>
10859+
<td>trafficDistribution for query-scheduler service</td>
10860+
<td><pre lang="json">
10861+
""
10862+
</pre>
1078510863
</td>
1078610864
</tr>
1078710865
<tr>
@@ -10899,6 +10977,7 @@ false
1089910977
"service": {
1090010978
"annotations": {},
1090110979
"labels": {},
10980+
"trafficDistribution": "",
1090210981
"type": "ClusterIP"
1090310982
},
1090410983
"targetModule": "read",
@@ -11288,6 +11367,15 @@ null
1128811367
<td><pre lang="json">
1128911368
{}
1129011369
</pre>
11370+
</td>
11371+
</tr>
11372+
<tr>
11373+
<td>read.service.trafficDistribution</td>
11374+
<td>string</td>
11375+
<td>trafficDistribution for read service</td>
11376+
<td><pre lang="json">
11377+
""
11378+
</pre>
1129111379
</td>
1129211380
</tr>
1129311381
<tr>
@@ -12779,6 +12867,15 @@ null
1277912867
<td><pre lang="json">
1278012868
{}
1278112869
</pre>
12870+
</td>
12871+
</tr>
12872+
<tr>
12873+
<td>singleBinary.service.trafficDistribution</td>
12874+
<td>string</td>
12875+
<td>trafficDistribution single binary Service</td>
12876+
<td><pre lang="json">
12877+
""
12878+
</pre>
1278212879
</td>
1278312880
</tr>
1278412881
<tr>
@@ -13652,6 +13749,15 @@ null
1365213749
<td><pre lang="json">
1365313750
{}
1365413751
</pre>
13752+
</td>
13753+
</tr>
13754+
<tr>
13755+
<td>write.service.trafficDistribution</td>
13756+
<td>string</td>
13757+
<td>trafficDistribution for write service</td>
13758+
<td><pre lang="json">
13759+
""
13760+
</pre>
1365513761
</td>
1365613762
</tr>
1365713763
<tr>

production/helm/loki/CHANGELOG.md

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

3233
## 6.43.0
3334

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
@@ -41,4 +41,7 @@ spec:
4141
{{- end }}
4242
selector:
4343
{{- include "loki.queryFrontendSelectorLabels" . | nindent 4 }}
44+
{{- with .Values.queryFrontend.trafficDistribution | default .Values.loki.service.trafficDistribution }}
45+
trafficDistribution: {{ . }}
46+
{{- end }}
4447
{{- 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)