Repository navigation
sourcegraph: add extraInitContainers and extraServicePorts to every component - #991
Draft
marcleblanc2 wants to merge 1 commit into
Draft
marcleblanc2 wants to merge 1 commit into
marcleblanc2 wants to merge 1 commit into
Conversation
…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
October 31, 2026 04:31
16a4b6d to
33601c6
Compare
marcleblanc2
marked this pull request as draft
October 31, 2026 04:34
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.
A customer needs
extraInitContainersandextraServicePortsto move from Kustomize to the Helm chart before the Kustomize deprecation in v8.5. See Slack thread for details.What changed
<serviceName>.extraInitContainerson all 21 workloads, includingopenTelemetry.agent/openTelemetry.gatewayandjaeger. Rendered before any init containers the chart defines (migratoron frontend,correct-data-dir-permissionson the databases).<serviceName>.extraServicePortson each component's primary Service (jaeger.collector/jaeger.query/openTelemetry.gatewayfor those). The secondarysourcegraph-frontend-internal,indexed-search-indexer, andworker-executorsServices are left alone, so an extra port 80 on frontend cannot collide with frontend-internal's existing port 80.toYamllists, unset by default.Checklist
Test plan
tests/extraInitContainersServicePorts_test.yamlsets both values on every component in one test and asserts the init container is index 0 on all 21 workloads (and index 1 ismigrator/correct-data-dir-permissionswhere the chart has one), noinitContainerskey by default, the port is appended on all 20 primary Services (including the 4-space-indentedotel-collectorService), 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 lintclean../scripts/helm-docs.shleaves no diff.kubeconform -strictpasses on the default render (69 resources) and on a render with init containers, extra ports, andextraVolumesset on frontend, otel gateway/agent, grafana, worker, and pgsql (73 resources).helm templatewith default values is byte-identical toorigin/main.