Skip to content

feat: add serviceAnnotations and trafficDistribution to service templates (PR 4090)#4113

Merged
dhruv-shah-sumo merged 5 commits intomainfrom
pr-4090
Mar 17, 2026
Merged

feat: add serviceAnnotations and trafficDistribution to service templates (PR 4090)#4113
dhruv-shah-sumo merged 5 commits intomainfrom
pr-4090

Conversation

@dhruv-shah-sumo
Copy link
Collaborator

@dhruv-shah-sumo dhruv-shah-sumo commented Mar 17, 2026

This PR is copied from #4090
Thanks to @abebars for introducing this changes.

Summary

Add configurable serviceAnnotations and trafficDistribution fields to the logs collector, metadata logs, and metrics service templates. This enables Kubernetes topology-aware routing to reduce cross-zone data transfer costs.

Motivation

Kubernetes 1.27+ supports trafficDistribution: PreferClose on Services, which routes traffic to endpoints in the same zone when possible. Combined with the service.kubernetes.io/topology-mode: Auto annotation, this significantly reduces cross-zone network costs in multi-AZ clusters.

Currently, there's no way to set these fields on the chart's services without maintaining local patches.

Changes

Templates modified (3 files):

  • templates/logs/collector/common/service.yaml — uses otellogs.serviceAnnotations / otellogs.trafficDistribution
  • templates/logs/common/service.yaml — uses metadata.serviceAnnotations / metadata.trafficDistribution
  • templates/metrics/common/service.yaml — uses metadata.serviceAnnotations / metadata.trafficDistribution
    values.yaml defaults:
metadata:
  serviceAnnotations: {}
  trafficDistribution: ""

otellogs:
  serviceAnnotations: {}
  trafficDistribution: ""

Usage

metadata:
  serviceAnnotations:
    service.kubernetes.io/topology-mode: "Auto"
  trafficDistribution: "PreferClose"

otellogs:
  serviceAnnotations:
    service.kubernetes.io/topology-mode: "Auto"
  trafficDistribution: "PreferClose"

References

Kubernetes Topology Aware Routing
KEP-4444: Traffic Distribution for Services

Checklist

  • Changelog updated or skip changelog label added
  • Documentation updated
  • Template tests added for new features
  • Integration tests added or modified for major features

abebars and others added 4 commits March 2, 2026 20:13
…ce templates

Add configurable serviceAnnotations and trafficDistribution fields to
the logs collector, metadata logs, and metrics service templates. This
enables Kubernetes topology-aware routing (trafficDistribution: PreferClose)
and the topology-mode annotation to reduce cross-zone data transfer costs.

New values:
- metadata.serviceAnnotations / metadata.trafficDistribution
- otellogs.serviceAnnotations / otellogs.trafficDistribution

Co-Authored-By: Claude <[email protected]>
Add towncrier changelog entry for the new serviceAnnotations and
trafficDistribution feature. Document new config keys in the Helm
chart README for metadata.* and otellogs.* sections.

Co-Authored-By: Claude <[email protected]>
Add README entries for the new serviceAnnotations and trafficDistribution
parameters for both metadata and otellogs services after merging main.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@dhruv-shah-sumo dhruv-shah-sumo requested a review from a team as a code owner March 17, 2026 06:00
Rename changelog file to reflect the correct PR number.

Co-Authored-By: Claude Opus 4.6 <[email protected]>
@dhruv-shah-sumo
Copy link
Collaborator Author

More context for internal discussions: https://sumologic.slack.com/archives/C09BL6UQ75Y/p1773199775247959

@dhruv-shah-sumo dhruv-shah-sumo merged commit 4627c66 into main Mar 17, 2026
82 checks passed
@dhruv-shah-sumo dhruv-shah-sumo deleted the pr-4090 branch March 17, 2026 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants