Skip to content

sourcegraph: add extraInitContainers and extraServicePorts to every component - #991

Draft
marcleblanc2 wants to merge 1 commit into
mainfrom
marc/extra-init-containers-service-ports
Draft

marcleblanc2 wants to merge 1 commit into
mainfrom
marc/extra-init-containers-service-ports

Conversation

@marcleblanc2

@marcleblanc2 marcleblanc2 commented Oct 31, 2026 •

Copy link
Copy Markdown
Contributor

A customer needs extraInitContainers and extraServicePorts to move from Kustomize to the Helm chart before the Kustomize deprecation in v8.5. See Slack thread for details.

What changed

  • <serviceName>.extraInitContainers on all 21 workloads, including openTelemetry.agent / openTelemetry.gateway and jaeger. Rendered before any init containers the chart defines (migrator on frontend, correct-data-dir-permissions on the databases).
  • <serviceName>.extraServicePorts on each component's primary Service (jaeger.collector / jaeger.query / openTelemetry.gateway for those). The secondary sourcegraph-frontend-internal, indexed-search-indexer, and worker-executors Services are left alone, so an extra port 80 on frontend cannot collide with frontend-internal's existing port 80.
  • Both are passthrough toYaml lists, unset by default.

Checklist

Test plan

  • New tests/extraInitContainersServicePorts_test.yaml sets both values on every component in one test and asserts the init container is index 0 on all 21 workloads (and index 1 is migrator / correct-data-dir-permissions where the chart has one), no initContainers key by default, the port is appended on all 20 primary Services (including the 4-space-indented otel-collector Service), and the 3 secondary Services are untouched. Verified the suite fails when the otel-collector indent is wrong.
  • helm unittest charts/sourcegraph: 37 suites, 223 tests, 12 snapshots pass. helm lint clean. ./scripts/helm-docs.sh leaves no diff.
  • kubeconform -strict passes on the default render (69 resources) and on a render with init containers, extra ports, and extraVolumes set on frontend, otel gateway/agent, grafana, worker, and pgsql (73 resources).
  • helm template with default values is byte-identical to origin/main.
  • Not deployed to a cluster.

@github-actions

Copy link
Copy Markdown

…omponent

Add `<serviceName>.extraInitContainers` to all 21 workloads, rendered
before any init containers the chart defines, so a user-supplied init
container (e.g. one that fetches database credentials from Vault) runs
before `migrator` on frontend. The grafana-only `initContainers` key is
replaced by the same `extraInitContainers` block the other components use.

Add `<serviceName>.extraServicePorts` to each component's primary
Service. The secondary `sourcegraph-frontend-internal`,
`indexed-search-indexer`, and `worker-executors` Services are left
unchanged so an extra port 80 on frontend does not collide with
frontend-internal's existing port 80.

Both values are passthrough `toYaml` lists and default to unset; the
default render is unchanged.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1902b-ece9-725c-863d-3e2bba35ee1d
Co-authored-by: Amp <amp@ampcode.com>
@marcleblanc2
marcleblanc2 force-pushed the marc/extra-init-containers-service-ports branch from 16a4b6d to 33601c6 Compare October 31, 2026 04:31
@marcleblanc2
marcleblanc2 requested a review from a team October 31, 2026 04:31
@marcleblanc2
marcleblanc2 marked this pull request as draft October 31, 2026 04:34

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