Skip to content

fix(signoz): decouple container ports from service ports - #899

Open
Mohith1612 wants to merge 1 commit into
SigNoz:mainfrom
Mohith1612:fix/signoz-container-port
Open

fix(signoz): decouple container ports from service ports#899
Mohith1612 wants to merge 1 commit into
SigNoz:mainfrom
Mohith1612:fix/signoz-container-port

Conversation

@Mohith1612

Copy link
Copy Markdown

Problem

A basic install that sets signoz.service.port to anything other than the default puts signoz-0 into CrashLoopBackOff, even though the container logs show the process starting cleanly. Reported in #762 with signoz.service.port: 80 for a LoadBalancer service.

The statefulset derived its container ports from the service port values:

ports:
  - name: http
    containerPort: {{ default 8080  .Values.signoz.service.port }}

but SigNoz always listens on 8080, 8085 and 4320 inside the container, and the chart has no way to change that. So signoz.service.port: 80 only renamed the port the container declares, it did not move the listener:

  • signoz.livenessProbe.port and readinessProbe.port default to the named port http, which now resolved to 80. Nothing was bound there, so the liveness probe failed and restarted the container in a loop.
  • Service.targetPort: http resolves by name too, so even with probes disabled the Service routed to a dead port.

The chart already assumes the fixed in-container ports in two other places, which is what made this inconsistent rather than intentional: signoz_alertmanager_signoz_external__url: http://localhost:8080 in values.yaml, and the hardcoded :4320 in the collector's OpAMP config. otelCollector.ports already models this properly with separate containerPort and servicePort per entry.

Changes

  • templates/signoz/statefulset.yaml: pin the container ports to 8080 / 8085 / 4320, so signoz.service.*Port now describes the Service only. Named-port resolution then does the right thing for both the probes and targetPort.
  • templates/otel-collector/configmap.yaml: the OpAMP server_endpoint dials the SigNoz Service, so it should follow signoz.service.opampPort instead of hardcoding 4320. Without this, changing opampPort moves the Service port and leaves the collector dialling 4320. Happy to drop this one if you would rather keep it separate.
  • values.yaml: note on each of the three signoz.service.*Port keys that the container port is fixed.
  • Bumped the chart to 0.135.2 and regenerated the README.

No new values keys: since the chart cannot change what the process binds to, a container-port knob would only be misleading. Let me know if you would prefer one anyway.

Testing

  • Added tests/signoz-service_port_test.yaml. The three regression cases fail on main and pass here; helm unittest charts/signoz is 4 suites / 18 tests green.
  • helm template charts/signoz on default values is byte-identical to main apart from the version label and the config checksum that label feeds into.
  • helm template charts/signoz --set signoz.service.port=80 now renders containerPort: 8080 with Service port: 80 and targetPort: http.
  • helm template charts/signoz --set signoz.service.opampPort=4321 renders ws://<release>-signoz:4321/v1/opamp.
  • helm lint --strict charts/signoz passes, and make chart-docs CHARTS=charts/signoz,charts/k8s-infra is clean after the commit.

Closes #762

The SigNoz statefulset derived its containerPorts from signoz.service.*Port,
but the process always listens on 8080, 8085 and 4320 inside the container.

Setting signoz.service.port to anything else therefore renamed the port the
container declares without moving the listener. Both probes default to the
named port `http`, so they ended up polling a port nothing was bound to and
the liveness failure restarted the pod in a loop. Service.targetPort resolves
by name too, so traffic went nowhere either.

Pin the container ports to the ports the application binds and leave
signoz.service.*Port to describe the Service alone. The OpAMP endpoint in the
collector config now follows signoz.service.opampPort as well, since it dials
the Service and previously hardcoded 4320.

Closes SigNoz#762
@Mohith1612
Mohith1612 requested a review from a team as a code owner July 31, 2026 11:34
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.

Basic Helm Install setting signoz.service.port fails

1 participant