Repository navigation
Conversation
maxsxu
left a comment
There was a problem hiding this comment.
The template changes and dig-based port derivation look clean, and I verified locally with make helm-unittest HELM_CHART=tempo (helmunittest/helm-unittest:4.2.0-1.1.0 --strict) that all 6 suites / 45 tests pass.
One thing needed before merge: #914 landed on main and already bumped charts/tempo to 3.2.1, so this branch will need a rebase onto main and a bump to 3.2.2.
| description: Grafana Tempo Single Binary Mode | ||
| type: application | ||
| version: 3.2.0 | ||
| version: 3.2.1 |
There was a problem hiding this comment.
main is already at 3.2.1 after #914 merged, so please rebase onto main and bump this to 3.2.2.
There was a problem hiding this comment.
| # $schema: https://raw.githubusercontent.com/helm-unittest/helm-unittest/refs/heads/main/schema/helm-testsuite.json | ||
| suite: receiver ports | ||
| templates: | ||
| - service.yaml |
There was a problem hiding this comment.
Optional nit: since service-headless.yaml also renders tempo.udp and tempo.tcp, you could include service-headless.yaml here as well to cover both Services.
There was a problem hiding this comment.
Good idea, added in 264701a: tests/ports_test.yaml now also renders service-headless.yaml, and each Service port assertion runs against both Services.
The Service took each receiver port from tempo.receivers but hard-coded targetPort to the default port, so changing an endpoint (for example otlp grpc to 0.0.0.0:14317) sent traffic to a port Tempo does not listen on. Removing a receiver with `tempo.receivers.jaeger: null` failed to render with a nil pointer error. The Service and the container also always exposed 9411 (zipkin), 55680 and 55681 (legacy OTLP), which nothing listens on unless a zipkin receiver is configured. Read every receiver endpoint with dig, use the endpoint port as both port and targetPort, add the zipkin port only when tempo.receivers.zipkin.endpoint is set, and build the container ports from the same endpoints. Signed-off-by: YoungjuKim <[email protected]>
65ef2c3 to
419df51
Compare
service-headless.yaml renders the same tempo.udp and tempo.tcp ports as service.yaml, so check both Services in tests/ports_test.yaml. Signed-off-by: YoungjuKim <[email protected]>
What this PR does / why we need it
The Service and the StatefulSet do not follow
tempo.receivers:Custom receiver ports are sent to the wrong container port.
_ports.tpltakes the Serviceportfrom the receiver endpoint but hard-codestargetPortto the default port. Withtempo.receivers.otlp.protocols.grpc.endpoint: 0.0.0.0:14317, chart 3.2.0 rendersTempo listens on 14317, so nothing answers on the target port. The same applies to the Jaeger ports.
A receiver cannot be removed.
--set tempo.receivers.jaeger=null(to turn off the Jaeger receiver) fails to render:tempo.receivers.jaeger.protocols=nullfails the same way. The receivers are rendered intotempo.yamlwithtoYaml, so the config itself already allows removing them.Ports that nothing listens on are always exposed. The Service and the container always list 9411 (
tempo-zipkin), 55680 and 55681 (legacy OTLP), even though the chart never configures a zipkin receiver and Tempo does not open the legacy OTLP ports.This PR:
dig, so a removed receiver or protocol just drops its port;portandtargetPort;tempo.receivers.zipkin.endpointis set, and drops 55680/55681;tempo.containerPorts) from the same endpoints, keeping the existing port names.Port names do not change, so ServiceMonitors, routes and anything else that refers to a port by name keep working. With the default values the only rendered difference is that 9411, 55680 and 55681 are gone from both Services and from the container.
route.yamlstill validatesbackendPortagainst the Service ports throughtempo.servicePorts.Chart version bumped to 3.2.2.
Which issue this PR fixes
No existing issue that I could find.
Special notes for your reviewer
How I checked it (Helm v3.18.2,
helm templateof chart 3.2.0 and of this branch):otlp.protocols.grpc.endpoint=0.0.0.0:14317port: 14317,targetPort: 4317; containerPort 4317port: 14317,targetPort: 14317; containerPort 14317jaeger=nulltempo.yamlhas onlyotlpzipkin.endpoint=0.0.0.0:9411ci/*.yamlvalues files render, andhelm lintpasses.connection refused, while 3200 and 4318 answer.tests/ports_test.yamlfor the cases above. After rebasing ontomain,make helm-unittest HELM_CHART=tempo(helmunittest/helm-unittest:4.2.0-1.1.0 --strict) passes all 6 suites / 45 tests. It also checksservice-headless.yaml, which renders the same ports.Someone who points a client at 9411 without configuring a zipkin receiver loses a Service port that never answered anyway. If you would rather keep that change out of this PR, I can split it.
Checklist
Prepared with help from Claude (AI), including the local checks described above.
🤖 Generated with Claude Code