Skip to content

fix/resources: Drop unused ports, Services, Role verbs, and settings - #1016

Open
marcleblanc2 wants to merge 7 commits into
mainfrom
marc/executor-k8s-remove-debug-port
Open

marcleblanc2 wants to merge 7 commits into
mainfrom
marc/executor-k8s-remove-debug-port

Conversation

@marcleblanc2

@marcleblanc2 marcleblanc2 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Summary

I checked every object, port, and setting the four charts render against what actually uses it, and opened this PR to remove the eight things that are not used

Removed Why it's unused
k8s executor: container port 6060 (http-debug) and the executor-<queueName> Service The executor hasn't served 6060 since Sourcegraph 4.1. The Service fronts only that port.
k8s executor: get and list on Pods, Secrets, and PVCs in its Role The executor stopped calling them in Sourcegraph 5.1
k8s executor: SRC_TRACE_LOG in its ConfigMap Nothing has read it since Sourcegraph 5.2
dind executor: container port 2375 on the dind sidecar dockerd listens on 127.0.0.1 only; the executor reaches it over localhost
otel-agent: port 55679 (http-zpages) and its hostPort zpages listens on localhost only
Jaeger: 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
Jaeger: Prometheus scrape annotations They point at port 16686, the UI, which returns 404 for /metrics. The scrape always failed
Prometheus: the kubernetes-services scrape job It probes through a blackbox exporter the chart doesn't ship, and no Service opts in

These values go with them and are ignored if still set: openTelemetry.agent.hostPorts.httpZpages, jaeger.config.samplingDefaultProbability, executor.log.trace, and the undocumented executor.serviceAnnotations, executor.serviceLabels, and executor.serviceType.

Upgrade impact

  • No admin action needed
  • No change to system behaviour
  • Helm deletes the executor-<queueName> Service
  • The k8s executor, dind executor, otel-agent, and jaeger pods restart once
  • Executor metrics are not affected: they go to frontend with each heartbeat, and Prometheus scrapes them from worker-executors

Evidence

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

Review

Reviewed on 2026-11-13 (review thread), at bc281c3. No open issues.

Tested on the EKS test instance m5, by upgrading from main to this branch merged onto main:

Not tested: an auto-indexing job (not enabled on the instance), and traces sent by Sourcegraph itself (the instance's collector is configured to log traces, not forward them).

Small ones, none blocking:

  • No test asserts that the removed objects, ports, and values stay removed
  • The zpages extension still runs in otel-agent, on localhost only

Executors stopped serving port 6060 in Sourcegraph 4.1, before this chart
existed, so the container port and the Service that fronts it have never
had a listener. The chart's probes use pgrep, and executor metrics reach
Prometheus through worker's worker-executors Service.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1d140-e6de-7173-8b4f-187543b7833c
Co-authored-by: Amp <amp@ampcode.com>
@github-actions

Copy link
Copy Markdown

@marcleblanc2
marcleblanc2 enabled auto-merge (squash) November 13, 2026 00:56
@marcleblanc2
marcleblanc2 requested a review from a team November 13, 2026 00:56
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>
marcleblanc2 and others added 5 commits November 12, 2026 22:22
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>
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>
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>
…move-debug-port

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

# Conflicts:
#	charts/sourcegraph-executor/CHANGELOG.md
#	charts/sourcegraph/CHANGELOG.md
@marcleblanc2 marcleblanc2 changed the title executor/k8s: remove the unused debug port 6060 and its Service Remove unused ports, Services, Role verbs, and settings from the charts Nov 13, 2026
@marcleblanc2 marcleblanc2 changed the title Remove unused ports, Services, Role verbs, and settings from the charts Drop unused ports, Services, Role verbs, and settings Nov 13, 2026
marcleblanc2 added a commit that referenced this pull request Nov 13, 2026
#1016 removes this job, because it probes
through a blackbox exporter the chart does not ship and no Service opts in.
Removing it here too, instead of scoping it to the release namespace, keeps
this PR and #1016 from conflicting in prometheus.ConfigMap.yaml.
marcleblanc2 added a commit that referenced this pull request Nov 13, 2026
…does

#1016 deletes the executor-<queueName>
Service, which fronts a port the executor has not served since 4.1, and
the kubernetes-services scrape job, which probes through a blackbox
exporter the chart does not ship. Making the same deletions here keeps
this PR and #1016 from conflicting in those files.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1d269-2788-7075-b66b-b87e3087047d
Co-authored-by: Amp <amp@ampcode.com>
marcleblanc2 added a commit that referenced this pull request Nov 13, 2026
#1016 deletes the executor's http-debug
port 6060 and the executor-<queueName> Service in front of it: the executor
has not served that port since Sourcegraph 4.1. Making the same deletions
here keeps this PR and #1016 from conflicting in those files.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1d269-2788-7075-b66b-b87e3087047d
Co-authored-by: Amp <amp@ampcode.com>
marcleblanc2 added a commit that referenced this pull request Nov 13, 2026
This replaces 4dc65cf, which served Jaeger's metrics on 0.0.0.0:8888 and
pointed the pod's prometheus.io/port annotation there.
#1016 removes the scrape annotations
instead: they pointed at port 16686, which has no /metrics, and Jaeger's
own otelcol_* metrics would otherwise mix into the OpenTelemetry Collector
dashboards. Making the same change here keeps this PR and #1016 from
conflicting in the Jaeger Deployment and the README.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1d269-2788-7075-b66b-b87e3087047d
Co-authored-by: Amp <amp@ampcode.com>
marcleblanc2 added a commit that referenced this pull request Nov 13, 2026
#1016 removes this job, because it probes
through a blackbox exporter the chart does not ship and no Service opts in.
Removing it here too, instead of scoping it to the release namespace, keeps
this PR and #1016 from conflicting in prometheus.ConfigMap.yaml.
marcleblanc2 added a commit that referenced this pull request Nov 13, 2026
…does

#1016 deletes the executor-<queueName>
Service, which fronts a port the executor has not served since 4.1, and
the kubernetes-services scrape job, which probes through a blackbox
exporter the chart does not ship. Making the same deletions here keeps
this PR and #1016 from conflicting in those files.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1d269-2788-7075-b66b-b87e3087047d
Co-authored-by: Amp <amp@ampcode.com>
marcleblanc2 added a commit that referenced this pull request Nov 13, 2026
This replaces 4dc65cf, which served Jaeger's metrics on 0.0.0.0:8888 and
pointed the pod's prometheus.io/port annotation there.
#1016 removes the scrape annotations
instead: they pointed at port 16686, which has no /metrics, and Jaeger's
own otelcol_* metrics would otherwise mix into the OpenTelemetry Collector
dashboards. Making the same change here keeps this PR and #1016 from
conflicting in the Jaeger Deployment and the README.

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 ports, Services, Role verbs, and settings fix/resources: Drop unused ports, Services, Role verbs, and settings Nov 13, 2026

This branch has not been deployed

No deployments
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