Repository navigation
sourcegraph: add extraInitContainers and extraServicePorts to every component - #991
Open
marcleblanc2 wants to merge 1 commit into
Open
marcleblanc2 wants to merge 1 commit into
marcleblanc2 wants to merge 1 commit into
Conversation
marcleblanc2
force-pushed
the
marc/extra-init-containers-service-ports
branch
from
October 31, 2026 04:31
16a4b6d to
33601c6
Compare
marcleblanc2
marked this pull request as draft
October 31, 2026 04:34
…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
force-pushed
the
marc/extra-init-containers-service-ports
branch
from
November 4, 2026 10:05
33601c6 to
799e5fe
Compare
marcleblanc2
marked this pull request as ready for review
November 4, 2026 10:05
marcleblanc2
enabled auto-merge (squash)
November 4, 2026 10:12
filiphaftek
approved these changes
Nov 4, 2026
filiphaftek
left a comment
Contributor
There was a problem hiding this comment.
I run agent to search for breaking change, but looks good :+1
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Solution
<serviceName>.extraInitContainerson all 21 workloads<serviceName>.extraServicePortsappended to each component's primary ServiceBoth are
toYamlpassthrough lists that render nothing when unsetgrafana.initContainersis replaced bygrafana.extraInitContainersThe secondary Services
sourcegraph-frontend-internal,indexed-search-indexer, andworker-executorsdo not getextraServicePorts. Frontend-internal already listens on port 80, so an extra port 80 on frontend would otherwise collide with itTested
New
tests/extraInitContainersServicePorts_test.yamlsets both values on every component at once and asserts: the extra init container is index 0 on all 21 workloads and the chart's own init container is index 1 where it has one, noinitContainerskey renders by default, the port is appended on all 20 primary Services, and the 3 secondary Services are unchangedhelm unittest charts/sourcegraph: 38 suites, 234 tests pass.helm lintclean../scripts/helm-docs.shleaves no diff.helm templatewith default values is byte-identical toorigin/mainkubeconform -strictpasses on the default render and on a render with both values set across frontend, otel, grafana, worker, and pgsqlDeployed to a test instance on EKS with both values set on every deployed component: frontend, gitserver, grafana, indexed-search, precise-code-intel-worker, prometheus, searcher, syntect-server, worker
Every pod ran its extra init container to
Completed;kubectl logs <pod> -c extra-init-checkshows its output on eachOn frontend, the extra init container ran before
migrator, and a file it wrote to anextraVolumesemptyDir is readable from the frontend containerOn grafana, a real native sidecar (
restartPolicy: Always, mints RDS IAM auth tokens) runs throughgrafana.extraInitContainersEvery primary Service shows the extra port, and
curlfrom another pod in the namespace returns 200 through it on frontend, grafana, prometheus, syntect-server, and workerAll pods Ready, site healthy
Amp threads
Changelog
<serviceName>.extraInitContainersto every workload<serviceName>.extraServicePortsto every component's primary ServiceChecklist