Skip to content

Commit c2cdf9e

Browse files
committed
feat: Add spec.trafficDistribution field for service
Add traffic distribution configuration to optimize Inter-AZ data transfer costs by enabling zone-aware traffic routing. This change introduces a new trafficDistribution field that allows configuring traffic locality preferences, zone affinity rules, and cross-AZ traffic minimization strategies. The implementation reduces cloud egress charges by prioritizing same-zone service-to-service communication while maintaining high availability through intelligent failover to other availability zones when local resources are unavailable. Reference: https://kubernetes.io/docs/concepts/services-networking/service/#traffic-distribution Signed-off-by: younsl <cysl@kakao.com>
1 parent efe0896 commit c2cdf9e

2 files changed

Lines changed: 8 additions & 0 deletions

File tree

charts/docker-mailserver/templates/service.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,6 @@ spec:
145145
{{- if .Values.service.clusterIp }}
146146
clusterIP: {{ .Values.service.clusterIp }}
147147
{{- end }}
148+
{{- if .Values.service.trafficDistribution }}
149+
trafficDistribution: {{ .Values.service.trafficDistribution }}
150+
{{- end }}

charts/docker-mailserver/values.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,11 @@ service:
300300
## Set it to "Local" when used with type "LoadBalancer" and set it to "Cluster" when used with "NodePort",
301301
## unless you have a good reason not to.
302302
# externalTrafficPolicy: "Cluster"
303+
## Traffic distribution preference for Services. One of:
304+
## - PreferClose (routes traffic to endpoints that are topologically proximate)
305+
## This field requires Kubernetes 1.31+ and is only available when the feature gate is enabled.
306+
## See: https://kubernetes.io/docs/concepts/services-networking/service/#traffic-distribution
307+
trafficDistribution: ""
303308
## If there is a port associated with a given service, expose it here.
304309
# port:
305310
## If there is a particular IP that should be used for the service, specify it here.

0 commit comments

Comments
 (0)