Skip to content

Remove unused ports, Role verbs, and settings from the charts - #1017

Closed
marcleblanc2 wants to merge 5 commits into
mainfrom
marc/remove-unused-resources
Closed

marcleblanc2 wants to merge 5 commits into
mainfrom
marc/remove-unused-resources

Conversation

@marcleblanc2

@marcleblanc2 marcleblanc2 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Following #1016, I checked every object and port the four charts render against what uses it. Almost everything is used. This PR removes the five things that are not.

Removed Why it's unused
otel-agent port 55679 (http-zpages) and its hostPort zpages listens on localhost only, so the port was never reachable from outside the pod. It just reserved 55679 on every node
Container port 2375 on the dind executor's dind sidecar dockerd listens on 127.0.0.1 only, and the executor reaches it over localhost
Jaeger's remote_sampling extension and port 5778 Nothing ever asked it for sampling strategies: no Service exposed the port, and Sourcegraph always set its own sampling
get and list on Pods, Secrets, and PVCs in the k8s executor's Role The executor stopped calling them in Sourcegraph 5.1, before this chart existed
SRC_TRACE_LOG in the k8s executor's ConfigMap Nothing has read it since Sourcegraph 5.2

Three values go with them and are ignored if still set: openTelemetry.agent.hostPorts.httpZpages, jaeger.config.samplingDefaultProbability, and executor.log.trace.

Upgrade impact

  • The otel-agent, jaeger, and dind executor pods restart once
  • No admin action needed

Evidence

  • On test instance m5: otel-agent listens on 127.0.0.1:55679 only, and connecting to 55679 on the pod IP or node IP fails. kubectl port-forward still reaches zpages
  • Jaeger 2.17.0 (the pinned image's version) with this PR's config: starts cleanly, accepts a trace, and shows it in the UI
  • 30 days of EKS audit logs for the k8s executor's ServiceAccount on m and m5: 365 requests, all create/delete on Jobs and Secrets, watch on Pods, or get on pods/log
  • lint.sh, helm unittest, and helm-docs pass. helm template against main differs only in the removed lines

Not tested: a live helm upgrade, the dind executor, or Jaeger on a cluster.

Heads-up for other PRs

Found, not changed

  • jaeger.serviceAccount.create: true fails the render: the template reads .Values.tracing
  • Jaeger's Prometheus scrape annotation points at port 16686, which has no /metrics
  • Prometheus's kubernetes-services job probes through a blackbox exporter the chart doesn't ship

The full inventory is in the Amp thread.

Changelog

  • Removed the unused http-zpages port and hostPort from the otel-agent DaemonSet; openTelemetry.agent.hostPorts.httpZpages no longer has any effect
  • Removed the unused container port 2375 from the dind executor's dind sidecar
  • Removed Jaeger's unused remote_sampling extension and port 5778; jaeger.config.samplingDefaultProbability no longer has any effect
  • Narrowed the k8s executor's Role to the calls the executor makes, and removed the unread SRC_TRACE_LOG setting and executor.log.trace value

Neither port has a listener reachable from outside its pod:

- otel-agent zpages binds localhost:55679, so hostPort 55679 only
  reserved the port on every node
- dockerd in the dind sidecar binds 127.0.0.1:2375, and the executor
  reaches it over localhost

Amp-Thread-ID: https://ampcode.com/threads/T-01a1d269-2788-7075-b66b-b87e3087047d
Co-authored-by: Amp <amp@ampcode.com>
@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Nothing ever asked Jaeger for sampling strategies: no Service exposed
5778, Sourcegraph and zoekt used a constant sampler while they had
Jaeger clients, and both use OpenTelemetry since Sourcegraph 4.0.
jaeger.config.samplingDefaultProbability is removed with it.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1d269-2788-7075-b66b-b87e3087047d
Co-authored-by: Amp <amp@ampcode.com>
@marcleblanc2 marcleblanc2 changed the title otel-agent, executor/dind: remove two unused ports otel-agent, jaeger, executor/dind: remove three unused ports Nov 13, 2026
The executor watches Pods, gets pods/log, and creates and deletes
Jobs, Secrets, and PVCs. It has not called get or list on Pods,
Secrets, or PVCs since Sourcegraph 5.1; 30 days of EKS audit logs on
two test instances show no such calls. SRC_TRACE_LOG has been unread
since Sourcegraph 5.2.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1d269-2788-7075-b66b-b87e3087047d
Co-authored-by: Amp <amp@ampcode.com>
@marcleblanc2 marcleblanc2 changed the title otel-agent, jaeger, executor/dind: remove three unused ports otel-agent, jaeger, executor: remove unused ports, Role verbs, and SRC_TRACE_LOG Nov 13, 2026
@marcleblanc2 marcleblanc2 changed the title otel-agent, jaeger, executor: remove unused ports, Role verbs, and SRC_TRACE_LOG Drop unused resources Nov 13, 2026
marcleblanc2 added a commit that referenced this pull request Nov 13, 2026
The cleanup CronJob runs as sg-executor and lists Jobs, Secrets, and
PVCs, and kubectl delete gets each one first. #1017 removes get and
list on Secrets and PVCs from the executor's Role, since the executor
never calls them, which would leave the CronJob with 403s. Grant get
and list on all three in a rule rendered only with
executor.cleanup.enabled, instead of on Jobs for every install.

kubectl delete also waits by default, which lists and watches an
object that lingers, such as a PVC held by its protection finalizer.
The Role has no watch, so delete with --wait=false.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1d269-2788-7075-b66b-b87e3087047d
Co-authored-by: Amp <amp@ampcode.com>
@marcleblanc2 marcleblanc2 changed the title Drop unused resources Remove unused ports, Role verbs, and settings from the charts Nov 13, 2026
The jaeger pod asked Prometheus to scrape port 16686, which serves the UI
and returns 404 for /metrics. The kubernetes-services job probed through
a blackbox exporter the chart does not ship, and no Service opts in.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1d269-2788-7075-b66b-b87e3087047d
Co-authored-by: Amp <amp@ampcode.com>
@marcleblanc2

Copy link
Copy Markdown
Contributor Author

Merged into #1016, so both changes get one review. Everything here, plus the Jaeger scrape annotation and the kubernetes-services blackbox job, is now in #1016.

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.

1 participant