Skip to content

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

Open
marcleblanc2 wants to merge 6 commits into
marc/labels-every-objectfrom
marc/executor-k8s-remove-debug-port
Open

marcleblanc2 wants to merge 6 commits into
marc/labels-every-objectfrom
marc/executor-k8s-remove-debug-port

Conversation

@marcleblanc2

@marcleblanc2 marcleblanc2 commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Problem

  • The four charts render eight things that nothing uses. I checked every object, port, and setting against what actually uses it

Solution

Removed Why it's unused
k8s executor: port 6060 (http-debug) and the executor-<queueName> Service The executor hasn't served 6060 since Sourcegraph 4.1, and 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: port 2375 on the dind sidecar dockerd listens on 127.0.0.1 only
otel-agent: port 55679 (http-zpages) and its hostPort zpages listens on localhost only
Jaeger: remote_sampling extension and port 5778 No Service exposed the port, and Sourcegraph sets its own sampling
Jaeger: Prometheus scrape annotations They point at port 16686, the UI, which has no /metrics
Prometheus: the kubernetes-services scrape job It probes through a blackbox exporter the chart doesn't ship

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, and 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: Prometheus scrapes them from worker-executors

Tested

  • At this head: helm unittest, helm lint, helm-docs, and kubeconform -strict pass. Rendered against feat/labels: Apply sourcegraph.labels to all objects in all four charts #1023, the only object removed is the executor Service
  • 30 days of EKS audit logs for the k8s executor's ServiceAccount show only the calls the narrowed Role still allows
  • On EKS, at the head before the rebase (bc281c3), upgrading from main:
    • k8s executor: the Service is deleted, no Forbidden in its logs, and a batch spec completes
    • dind executor: port 2375 is gone, and it still sends heartbeats
    • otel-agent: port 55679 is closed on the node
    • Jaeger: starts clean, and a span sent to otel-agent shows up in its UI
    • Prometheus: no kubernetes-services job once the pod restarts, and the other targets are unchanged
  • Not tested: an auto-indexing job, and traces sent by Sourcegraph itself
  • No test asserts that the removed objects, ports, and values stay removed

Amp threads

Changelog

  • Removed unused ports, the executor-<queueName> Service, unused Role verbs, SRC_TRACE_LOG, Jaeger's remote_sampling extension and scrape annotations, and the kubernetes-services scrape job

@github-actions

github-actions Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

@marcleblanc2
marcleblanc2 enabled stacked auto-merge (squash) November 13, 2026 00:56
@marcleblanc2
marcleblanc2 requested a review from a team November 13, 2026 00:56
@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
marcleblanc2 disabled stacked auto-merge November 13, 2026 05:26
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
@marcleblanc2
marcleblanc2 force-pushed the marc/executor-k8s-remove-debug-port branch from bc281c3 to 86d1174 Compare November 18, 2026 18:09
@marcleblanc2
marcleblanc2 changed the base branch from main to marc/labels-every-object November 18, 2026 18:10
@marcleblanc2
marcleblanc2 added this pull request to stack #1009 November 18, 2026 18:10
@marcleblanc2
marcleblanc2 force-pushed the marc/executor-k8s-remove-debug-port branch from 86d1174 to efeff50 Compare November 18, 2026 18:41
@marcleblanc2
marcleblanc2 force-pushed the marc/executor-k8s-remove-debug-port branch from efeff50 to 0d47693 Compare November 18, 2026 19:54
@marcleblanc2
marcleblanc2 force-pushed the marc/executor-k8s-remove-debug-port branch from 0d47693 to 4e0e79c Compare November 18, 2026 20:08
@marcleblanc2
marcleblanc2 force-pushed the marc/executor-k8s-remove-debug-port branch 3 times, most recently from 5981484 to e1a48b1 Compare November 18, 2026 20:32
marcleblanc2 and others added 6 commits November 18, 2026 14:35
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>
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>
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>
@marcleblanc2
marcleblanc2 force-pushed the marc/executor-k8s-remove-debug-port branch from e1a48b1 to fcfa62d Compare November 18, 2026 20:35

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