From f3f98da394f8de91384b6e8b1fe4b6cd5f621fec Mon Sep 17 00:00:00 2001 From: Marc <7050295+marcleblanc2@users.noreply.github.com> Date: Thu, 26 Jun 2025 16:33:59 -0600 Subject: [PATCH] Create config for sgTestConnection enabled (#706) Allow self-hosted customers to disable the sg-test-connection pod, similar to how the Cloud instances do (https://github.com/sourcegraph/cloud/pull/8) ### Checklist - [x] Follow the [manual testing process](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/TEST.md) - [ ] Update [changelog](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/charts/sourcegraph/CHANGELOG.md) - [ ] Update [Kubernetes update doc](https://docs.sourcegraph.com/admin/updates/kubernetes) ### Test plan Ran `helm template`, `helm lint`, and `helm unittest`, all passed (cherry picked from commit 3121258c6cc80921bb31f4d1f537c940bf5aa58f) --- charts/sourcegraph/README.md | 1 + charts/sourcegraph/templates/tests/test-connection.yaml | 4 +++- charts/sourcegraph/values.yaml | 4 ++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/charts/sourcegraph/README.md b/charts/sourcegraph/README.md index 08110c8e..5b68195b 100644 --- a/charts/sourcegraph/README.md +++ b/charts/sourcegraph/README.md @@ -299,6 +299,7 @@ In addition to the documented values, all services also support the following va | searcher.serviceAccount.create | bool | `false` | Enable creation of ServiceAccount for `searcher` | | searcher.serviceAccount.name | string | `""` | Name of the ServiceAccount to be created or an existing ServiceAccount | | searcher.storageSize | string | `"26Gi"` | Size of the PVC for searcher pods to store cache data | +| sgTestConnection | object | `{"enabled":true}` | Enable the busybox connection test after deployment | | sourcegraph.affinity | object | `{}` | Global Affinity, learn more from the [Kubernetes documentation](https://kubernetes.io/docs/concepts/scheduling-eviction/assign-pod-node/#affinity-and-anti-affinity) | | sourcegraph.image.defaultTag | string | `"{{ .Chart.AppVersion }}"` | Global docker image tag | | sourcegraph.image.pullPolicy | string | `"IfNotPresent"` | Global docker image pull policy | diff --git a/charts/sourcegraph/templates/tests/test-connection.yaml b/charts/sourcegraph/templates/tests/test-connection.yaml index 8bf16f39..1fdec25a 100644 --- a/charts/sourcegraph/templates/tests/test-connection.yaml +++ b/charts/sourcegraph/templates/tests/test-connection.yaml @@ -1,3 +1,4 @@ +{{- if .Values.sgTestConnection.enabled }} apiVersion: v1 kind: Pod metadata: @@ -12,4 +13,5 @@ spec: image: busybox command: ['wget'] args: ['sourcegraph-frontend:30080/'] - restartPolicy: Never \ No newline at end of file + restartPolicy: Never +{{- end }} diff --git a/charts/sourcegraph/values.yaml b/charts/sourcegraph/values.yaml index afab1c1f..e4cdf630 100644 --- a/charts/sourcegraph/values.yaml +++ b/charts/sourcegraph/values.yaml @@ -1264,3 +1264,7 @@ extraResources: [] # preemptionPolicy: Never # description: "gitserver priority class" priorityClasses: [] + +# -- Enable the busybox connection test after deployment +sgTestConnection: + enabled: true