diff --git a/docs/sources/setup/install/helm/reference.md b/docs/sources/setup/install/helm/reference.md
index 10537abc79457..f091bb84f770d 100644
--- a/docs/sources/setup/install/helm/reference.md
+++ b/docs/sources/setup/install/helm/reference.md
@@ -414,6 +414,7 @@ This is the generated reference for the Loki Helm Chart values.
"service": {
"annotations": {},
"labels": {},
+ "trafficDistribution": "",
"type": "ClusterIP"
},
"targetModule": "backend",
@@ -777,6 +778,15 @@ null
{}
+ |
+
+
+ | backend.service.trafficDistribution |
+ string |
+ trafficDistribution for backend Service |
+
+""
+
|
@@ -5251,6 +5261,15 @@ null
80
+ |
+
+
+ | gateway.service.trafficDistribution |
+ string |
+ trafficDistribution for gateway service |
+
+""
+
|
@@ -5484,6 +5503,7 @@ null
"terminationGracePeriodSeconds": 300,
"tolerations": [],
"topologySpreadConstraints": [],
+ "trafficDistribution": "",
"updateStrategy": {
"type": "RollingUpdate"
}
@@ -5835,6 +5855,15 @@ null
[]
+ |
+
+
+ | indexGateway.trafficDistribution |
+ string |
+ trafficDistribution for index-gateway service |
+
+""
+
|
@@ -5960,6 +5989,7 @@ null
"whenUnsatisfiable": "ScheduleAnyway"
}
],
+ "trafficDistribution": "",
"updateStrategy": {
"type": "RollingUpdate"
},
@@ -6362,7 +6392,7 @@ false
| ingester.serviceAnnotations |
object |
- Annotations for ingestor service |
+ Annotations for ingester service |
{}
@@ -6371,7 +6401,7 @@ false
|
| ingester.serviceLabels |
object |
- Labels for ingestor service |
+ Labels for ingester service |
{}
@@ -6380,7 +6410,7 @@ false
|
| ingester.serviceType |
string |
- Service type for ingestor service |
+ Service type for ingester service |
"ClusterIP"
@@ -6411,6 +6441,15 @@ false
|
Defaults to allow skew no more than 1 node
+ |
+
+
+ | ingester.trafficDistribution |
+ string |
+ trafficDistribution for ingester service |
+
+""
+
|
@@ -7174,6 +7213,15 @@ null
"http_server_write_timeout": "600s"
}
+
+
+
+ | loki.service.trafficDistribution |
+ string |
+ trafficDistribution for services Ref: https://kubernetes.io/docs/concepts/services-networking/service/#traffic-distribution |
+
+""
+
|
@@ -9729,7 +9777,8 @@ null
"topologyKey": "kubernetes.io/hostname",
"whenUnsatisfiable": "ScheduleAnyway"
}
- ]
+ ],
+ "trafficDistribution": ""
}
@@ -10094,6 +10143,15 @@ null
Defaults to allow skew no more then 1 node
+ |
+
+
+ | querier.trafficDistribution |
+ string |
+ trafficDistribution for querier service |
+
+""
+
|
@@ -10164,7 +10222,8 @@ Defaults to allow skew no more then 1 node
"serviceType": "ClusterIP",
"terminationGracePeriodSeconds": 30,
"tolerations": [],
- "topologySpreadConstraints": []
+ "topologySpreadConstraints": [],
+ "trafficDistribution": ""
}
@@ -10522,6 +10581,15 @@ null
[]
+ |
+
+
+ | queryFrontend.trafficDistribution |
+ string |
+ trafficDistribution for query-frontend service |
+
+""
+
|
@@ -10575,7 +10643,8 @@ null
"serviceLabels": {},
"terminationGracePeriodSeconds": 30,
"tolerations": [],
- "topologySpreadConstraints": []
+ "topologySpreadConstraints": [],
+ "trafficDistribution": ""
}
@@ -10823,6 +10892,15 @@ null
[]
+ |
+
+
+ | queryScheduler.trafficDistribution |
+ string |
+ trafficDistribution for query-scheduler service |
+
+""
+
|
@@ -10940,6 +11018,7 @@ false
"service": {
"annotations": {},
"labels": {},
+ "trafficDistribution": "",
"type": "ClusterIP"
},
"targetModule": "read",
@@ -11329,6 +11408,15 @@ null
{}
+ |
+
+
+ | read.service.trafficDistribution |
+ string |
+ trafficDistribution for read service |
+
+""
+
|
@@ -12820,6 +12908,15 @@ null
{}
+ |
+
+
+ | singleBinary.service.trafficDistribution |
+ string |
+ trafficDistribution single binary Service |
+
+""
+
|
@@ -13702,6 +13799,15 @@ null
{}
+ |
+
+
+ | write.service.trafficDistribution |
+ string |
+ trafficDistribution for write service |
+
+""
+
|
diff --git a/production/helm/loki/CHANGELOG.md b/production/helm/loki/CHANGELOG.md
index 93487e40a2221..8e3fd5c55df10 100644
--- a/production/helm/loki/CHANGELOG.md
+++ b/production/helm/loki/CHANGELOG.md
@@ -46,6 +46,7 @@ Entries should include a reference to the pull request that introduced the chang
- [CHANGE] Changed version of Grafana Loki to 3.5.7.
- [FEATURE] Allow auto-resizing the volume by recreating the StatefulSet. [#19217](https://github.com/grafana/loki/pull/19217).
- [BUGFIX] Add single-binary component to the podSelector. [#19229](https://github.com/grafana/loki/pull/19229).
+- [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
## 6.43.0
diff --git a/production/helm/loki/templates/backend/service-backend.yaml b/production/helm/loki/templates/backend/service-backend.yaml
index 4cf1570adab7c..7aae1fc0f96d6 100644
--- a/production/helm/loki/templates/backend/service-backend.yaml
+++ b/production/helm/loki/templates/backend/service-backend.yaml
@@ -34,4 +34,7 @@ spec:
protocol: TCP
selector:
{{- include "loki.backendSelectorLabels" . | nindent 4 }}
+{{- with .Values.backend.service.trafficDistribution | default .Values.loki.service.trafficDistribution }}
+ trafficDistribution: {{ . }}
+{{- end }}
{{- end }}
diff --git a/production/helm/loki/templates/distributor/service-distributor.yaml b/production/helm/loki/templates/distributor/service-distributor.yaml
index 77ddaa4753a1e..9f7901e3216f4 100644
--- a/production/helm/loki/templates/distributor/service-distributor.yaml
+++ b/production/helm/loki/templates/distributor/service-distributor.yaml
@@ -33,7 +33,7 @@ spec:
{{- end }}
selector:
{{- include "loki.distributorSelectorLabels" . | nindent 4 }}
-{{- if .Values.distributor.trafficDistribution }}
- trafficDistribution: {{ .Values.distributor.trafficDistribution }}
+{{- with .Values.distributor.trafficDistribution | default .Values.loki.service.trafficDistribution }}
+ trafficDistribution: {{ . }}
{{- end }}
{{- end -}}
diff --git a/production/helm/loki/templates/gateway/service-gateway.yaml b/production/helm/loki/templates/gateway/service-gateway.yaml
index 683973ce066ae..de6a57cc640f6 100644
--- a/production/helm/loki/templates/gateway/service-gateway.yaml
+++ b/production/helm/loki/templates/gateway/service-gateway.yaml
@@ -40,4 +40,7 @@ spec:
protocol: TCP
selector:
{{- include "loki.gatewaySelectorLabels" . | nindent 4 }}
+{{- with .Values.gateway.service.trafficDistribution | default .Values.loki.service.trafficDistribution }}
+ trafficDistribution: {{ . }}
+{{- end }}
{{- end }}
diff --git a/production/helm/loki/templates/index-gateway/service-index-gateway.yaml b/production/helm/loki/templates/index-gateway/service-index-gateway.yaml
index 67a82fab32d21..37d1f6f865a7b 100644
--- a/production/helm/loki/templates/index-gateway/service-index-gateway.yaml
+++ b/production/helm/loki/templates/index-gateway/service-index-gateway.yaml
@@ -33,4 +33,7 @@ spec:
{{- end }}
selector:
{{- include "loki.indexGatewaySelectorLabels" . | nindent 4 }}
+{{- with .Values.indexGateway.trafficDistribution | default .Values.loki.service.trafficDistribution }}
+ trafficDistribution: {{ . }}
+{{- end }}
{{- end }}
diff --git a/production/helm/loki/templates/ingester/service-ingester.yaml b/production/helm/loki/templates/ingester/service-ingester.yaml
index 2090fc94b2ec3..a74ed9631fe32 100644
--- a/production/helm/loki/templates/ingester/service-ingester.yaml
+++ b/production/helm/loki/templates/ingester/service-ingester.yaml
@@ -33,4 +33,7 @@ spec:
{{- end }}
selector:
{{- include "loki.ingesterSelectorLabels" . | nindent 4 }}
+{{- with .Values.ingester.trafficDistribution | default .Values.loki.service.trafficDistribution }}
+ trafficDistribution: {{ . }}
+{{- end }}
{{- end -}}
diff --git a/production/helm/loki/templates/querier/service-querier.yaml b/production/helm/loki/templates/querier/service-querier.yaml
index a1b43dfa23816..e54f0ff09ae63 100644
--- a/production/helm/loki/templates/querier/service-querier.yaml
+++ b/production/helm/loki/templates/querier/service-querier.yaml
@@ -33,4 +33,7 @@ spec:
{{- end }}
selector:
{{- include "loki.querierSelectorLabels" . | nindent 4 }}
+{{- with .Values.querier.trafficDistribution | default .Values.loki.service.trafficDistribution }}
+ trafficDistribution: {{ . }}
+{{- end }}
{{- end -}}
diff --git a/production/helm/loki/templates/query-frontend/service-query-frontend.yaml b/production/helm/loki/templates/query-frontend/service-query-frontend.yaml
index da31d9abd2422..efd55790cead5 100644
--- a/production/helm/loki/templates/query-frontend/service-query-frontend.yaml
+++ b/production/helm/loki/templates/query-frontend/service-query-frontend.yaml
@@ -43,4 +43,7 @@ spec:
{{- end }}
selector:
{{- include "loki.queryFrontendSelectorLabels" . | nindent 4 }}
+{{- with .Values.queryFrontend.trafficDistribution | default .Values.loki.service.trafficDistribution }}
+ trafficDistribution: {{ . }}
+{{- end }}
{{- end -}}
diff --git a/production/helm/loki/templates/query-scheduler/service-query-scheduler.yaml b/production/helm/loki/templates/query-scheduler/service-query-scheduler.yaml
index 20908b7155515..ea554b15300df 100644
--- a/production/helm/loki/templates/query-scheduler/service-query-scheduler.yaml
+++ b/production/helm/loki/templates/query-scheduler/service-query-scheduler.yaml
@@ -35,4 +35,7 @@ spec:
{{- end }}
selector:
{{- include "loki.querySchedulerSelectorLabels" . | nindent 4 }}
+{{- with .Values.queryScheduler.trafficDistribution | default .Values.loki.service.trafficDistribution }}
+ trafficDistribution: {{ . }}
+{{- end }}
{{- end }}
diff --git a/production/helm/loki/templates/read/service-read.yaml b/production/helm/loki/templates/read/service-read.yaml
index a5bc9d6dc355c..2c9c51bbc0c4b 100644
--- a/production/helm/loki/templates/read/service-read.yaml
+++ b/production/helm/loki/templates/read/service-read.yaml
@@ -34,4 +34,7 @@ spec:
protocol: TCP
selector:
{{- include "loki.readSelectorLabels" . | nindent 4 }}
+{{- with .Values.read.service.trafficDistribution | default .Values.loki.service.trafficDistribution }}
+ trafficDistribution: {{ . }}
+{{- end }}
{{- end }}
diff --git a/production/helm/loki/templates/write/service-write.yaml b/production/helm/loki/templates/write/service-write.yaml
index 50b9d77e0b7fc..5f329505c2777 100644
--- a/production/helm/loki/templates/write/service-write.yaml
+++ b/production/helm/loki/templates/write/service-write.yaml
@@ -34,4 +34,7 @@ spec:
protocol: TCP
selector:
{{- include "loki.writeSelectorLabels" . | nindent 4 }}
+{{- with .Values.write.service.trafficDistribution | default .Values.loki.service.trafficDistribution }}
+ trafficDistribution: {{ . }}
+{{- end }}
{{- end }}
diff --git a/production/helm/loki/values.yaml b/production/helm/loki/values.yaml
index 4786759719ec6..d8a5b00eddc00 100644
--- a/production/helm/loki/values.yaml
+++ b/production/helm/loki/values.yaml
@@ -403,6 +403,10 @@ loki:
grpc_listen_port: 9095
http_server_read_timeout: 600s
http_server_write_timeout: 600s
+ service:
+ # -- trafficDistribution for services
+ # Ref: https://kubernetes.io/docs/concepts/services-networking/service/#traffic-distribution
+ trafficDistribution: ""
# -- Limits config
limits_config:
reject_old_samples: true
@@ -1166,6 +1170,8 @@ gateway:
annotations: {}
# -- Labels for gateway service
labels: {}
+ # -- trafficDistribution for gateway service
+ trafficDistribution: ""
# Gateway ingress configuration
ingress:
# -- Specifies whether an ingress for the gateway should be created
@@ -1473,6 +1479,8 @@ singleBinary:
labels: {}
# -- Service Type for single binary Service
type: "ClusterIP"
+ # -- trafficDistribution single binary Service
+ trafficDistribution: ""
# -- Comma-separated list of Loki modules to load for the single binary
targetModule: "all"
# -- Labels for single binary service
@@ -1607,6 +1615,8 @@ write:
labels: {}
# -- Service Type for write Service
type: "ClusterIP"
+ # -- trafficDistribution for write service
+ trafficDistribution: ""
# -- Comma-separated list of Loki modules to load for the write
targetModule: "write"
# -- Additional CLI args for the write
@@ -1741,6 +1751,8 @@ read:
labels: {}
# -- Service Type for read Service
type: ClusterIP
+ # -- trafficDistribution for read service
+ trafficDistribution: ""
# -- Comma-separated list of Loki modules to load for the read
targetModule: "read"
# -- Whether or not to use the 2 target type simple scalable mode (read, write) or the
@@ -1868,6 +1880,8 @@ backend:
labels: {}
# -- Service type for backend Service
type: ClusterIP
+ # -- trafficDistribution for backend Service
+ trafficDistribution: ""
# -- Comma-separated list of Loki modules to load for the backend
targetModule: "backend"
# -- Additional CLI args for the backend
@@ -2005,11 +2019,11 @@ ingester:
# -- Annotations for ingester pods
podAnnotations: {}
# -- The name of the PriorityClass for ingester pods
- # -- Labels for ingestor service
+ # -- Labels for ingester service
serviceLabels: {}
- # -- Annotations for ingestor service
+ # -- Annotations for ingester service
serviceAnnotations: {}
- # -- Service type for ingestor service
+ # -- Service type for ingester service
serviceType: "ClusterIP"
# -- Additional CLI args for the ingester
extraArgs: []
@@ -2103,6 +2117,8 @@ ingester:
appProtocol:
# -- Set the optional grpc service protocol. Ex: "grpc", "http2" or "https"
grpc: ""
+ # -- trafficDistribution for ingester service
+ trafficDistribution: ""
# -- Enabling zone awareness on ingesters will create 3 statefulests where all writes will send a replica to each zone.
# This is primarily intended to accelerate rollout operations by allowing for multiple ingesters within a single
# zone to be shutdown and restart simultaneously (the remaining 2 zones will be guaranteed to have at least one copy
@@ -2381,6 +2397,8 @@ querier:
appProtocol:
# -- Set the optional grpc service protocol. Ex: "grpc", "http2" or "https"
grpc: ""
+ # -- trafficDistribution for querier service
+ trafficDistribution: ""
# -- Configuration for the query-frontend
queryFrontend:
# -- Number of replicas for the query-frontend
@@ -2486,6 +2504,8 @@ queryFrontend:
# -- Enable load balancer port for query-frontend
loadBalancer:
enabled: true
+ # -- trafficDistribution for query-frontend service
+ trafficDistribution: ""
# -- Configuration for the query-scheduler
queryScheduler:
# -- Number of replicas for the query-scheduler.
@@ -2560,6 +2580,8 @@ queryScheduler:
# -- Set the optional grpc service protocol. Ex: "grpc", "http2" or "https"
appProtocol:
grpc: ""
+ # -- trafficDistribution for query-scheduler service
+ trafficDistribution: ""
# -- Configuration for the index-gateway
indexGateway:
# -- Number of replicas for the index-gateway
@@ -2662,6 +2684,8 @@ indexGateway:
# -- Set the optional grpc service protocol. Ex: "grpc", "http2" or "https"
appProtocol:
grpc: ""
+ # -- trafficDistribution for index-gateway service
+ trafficDistribution: ""
# -- UpdateStrategy for the indexGateway StatefulSet.
updateStrategy:
# -- One of 'OnDelete' or 'RollingUpdate'