From ed8e81c777a6ab09a9b9fde30a0b0857c2b7b4b9 Mon Sep 17 00:00:00 2001 From: Marc <7050295+marcleblanc2@users.noreply.github.com> Date: Fri, 8 Aug 2025 03:30:36 -0600 Subject: [PATCH 1/2] Add example showing reuse of k8s secret for executors --- .../examples/private-image-registry/override.yaml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/charts/sourcegraph/examples/private-image-registry/override.yaml b/charts/sourcegraph/examples/private-image-registry/override.yaml index c95d4b48..39fefea6 100644 --- a/charts/sourcegraph/examples/private-image-registry/override.yaml +++ b/charts/sourcegraph/examples/private-image-registry/override.yaml @@ -25,3 +25,9 @@ alpine: image: name: alpine # Use a custom name instead of the Sourcegraph name - i.e. alpine-3.12 tag: 3.12 # Use a custom tag instead of the default - i.e. 3.35.1 + +# Allow Executors to use the same registry credentials to pull the needed images for Batch Changes and Autoindexing +executor: + extraEnv: + - name: KUBERNETES_IMAGE_PULL_SECRETS + value: regcred From 65300acd3fec48960c4d723451cfd844627edbb3 Mon Sep 17 00:00:00 2001 From: Marc LeBlanc Date: Fri, 8 Aug 2025 03:35:01 -0600 Subject: [PATCH 2/2] Adding example file --- .../examples/private-image-registry/override.yaml | 15 +++++++++++++++ .../examples/private-image-registry/override.yaml | 2 +- 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 charts/sourcegraph-executor/k8s/examples/private-image-registry/override.yaml diff --git a/charts/sourcegraph-executor/k8s/examples/private-image-registry/override.yaml b/charts/sourcegraph-executor/k8s/examples/private-image-registry/override.yaml new file mode 100644 index 00000000..4be5067f --- /dev/null +++ b/charts/sourcegraph-executor/k8s/examples/private-image-registry/override.yaml @@ -0,0 +1,15 @@ +## Override file demonstrating the use of a private docker image registry and custom image names + +sourcegraph: + image: + repository: custom-repo.ecr.us-east-1.amazonaws.com/sourcegraph + + # Registry credentials: https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry + imagePullSecrets: + - name: regcred # Pre-existing secret that contains the credentials needed to pull from the image registry + +# Allow Executors to reuse the same registry credentials to pull the needed images for Batch Changes and Auto-indexing +executor: + extraEnv: + - name: KUBERNETES_IMAGE_PULL_SECRETS + value: regcred diff --git a/charts/sourcegraph/examples/private-image-registry/override.yaml b/charts/sourcegraph/examples/private-image-registry/override.yaml index 39fefea6..f6e91ca9 100644 --- a/charts/sourcegraph/examples/private-image-registry/override.yaml +++ b/charts/sourcegraph/examples/private-image-registry/override.yaml @@ -26,7 +26,7 @@ alpine: name: alpine # Use a custom name instead of the Sourcegraph name - i.e. alpine-3.12 tag: 3.12 # Use a custom tag instead of the default - i.e. 3.35.1 -# Allow Executors to use the same registry credentials to pull the needed images for Batch Changes and Autoindexing +# Allow Executors to reuse the same registry credentials to pull the needed images for Batch Changes and Auto-indexing executor: extraEnv: - name: KUBERNETES_IMAGE_PULL_SECRETS