From 314ea860059b8c2c423d2dda6b9e991db40655cf Mon Sep 17 00:00:00 2001 From: Stefan Hengl Date: Tue, 20 May 2025 15:47:15 +0200 Subject: [PATCH 1/5] search: document INDEX_SEARCH_INDEXERS --- .../admin/deploy/docker-compose/configuration.mdx | 2 ++ docs/admin/deploy/kubernetes/configure.mdx | 2 ++ docs/admin/deploy/without_service_discovery.mdx | 15 +++++++++++++++ 3 files changed, 19 insertions(+) create mode 100644 docs/admin/deploy/without_service_discovery.mdx diff --git a/docs/admin/deploy/docker-compose/configuration.mdx b/docs/admin/deploy/docker-compose/configuration.mdx index 2ff227f05..77be9f125 100644 --- a/docs/admin/deploy/docker-compose/configuration.mdx +++ b/docs/admin/deploy/docker-compose/configuration.mdx @@ -135,6 +135,7 @@ services: environment: - 'SRC_GIT_SERVERS=2' - 'INDEXED_SEARCH_SERVERS=2' + - 'INDEXED_SEARCH_INDEXERS=2' - 'SEARCHER_URL=1' - 'SYMBOLS_URL=1' @@ -142,6 +143,7 @@ services: environment: - 'SRC_GIT_SERVERS=2' - 'INDEXED_SEARCH_SERVERS=2' + - 'INDEXED_SEARCH_INDEXERS=2' - 'SEARCHER_URL=1' - 'SYMBOLS_URL=1' ``` diff --git a/docs/admin/deploy/kubernetes/configure.mdx b/docs/admin/deploy/kubernetes/configure.mdx index c66ec24ec..4144a87fa 100644 --- a/docs/admin/deploy/kubernetes/configure.mdx +++ b/docs/admin/deploy/kubernetes/configure.mdx @@ -82,6 +82,8 @@ RBAC must be enabled in your cluster for the frontend to communicate with other This will allow the frontend service to discover endpoints for each service replica and communicate with them through the Kubernetes API. Note that this component should only be added if RBAC is enabled in your cluster. +> **If you are not using Kubernetes service discovery (for example, if you are running without RBAC or outside Kubernetes), you must manually configure service endpoints for the frontend.** See [Running Sourcegraph Without Kubernetes Service Discovery](/admin/deploy/without_service_discovery) for instructions. + --- ## Monitoring stack diff --git a/docs/admin/deploy/without_service_discovery.mdx b/docs/admin/deploy/without_service_discovery.mdx new file mode 100644 index 000000000..700a00204 --- /dev/null +++ b/docs/admin/deploy/without_service_discovery.mdx @@ -0,0 +1,15 @@ +# Running Sourcegraph Without Kubernetes Service Discovery + +Not settting these environment variables might prevent pods from starting when running without service discovery. + +If you are deploying Sourcegraph in an environment **without Kubernetes service discovery** (for example, using Docker Compose or single-container Docker), you must manually configure the frontend service to know about the other service replicas. This is typically required when you are not using RBAC or the `service-discovery` component in Kubernetes, or when running outside Kubernetes entirely. + +## Required Environment Variables + +- INDEXED_SEARCH_INDEXER +- INDEXED_SEARCH_SERVERS +- SEARCHER_URL +- SRC_GIT_SERVERS +- SYMBOLS_URL + +For detailed instructions on how to set these environment variables in a Docker Compose deployment, see the [Docker Compose configuration guide](/admin/deploy/docker-compose/configuration#set-environment-variables). From 6729a2fb87ac6862e186379b574acaf963ade764 Mon Sep 17 00:00:00 2001 From: Stefan Hengl Date: Tue, 20 May 2025 15:55:19 +0200 Subject: [PATCH 2/5] formatting --- docs/admin/deploy/kubernetes/configure.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/admin/deploy/kubernetes/configure.mdx b/docs/admin/deploy/kubernetes/configure.mdx index 4144a87fa..40770c5b5 100644 --- a/docs/admin/deploy/kubernetes/configure.mdx +++ b/docs/admin/deploy/kubernetes/configure.mdx @@ -82,7 +82,7 @@ RBAC must be enabled in your cluster for the frontend to communicate with other This will allow the frontend service to discover endpoints for each service replica and communicate with them through the Kubernetes API. Note that this component should only be added if RBAC is enabled in your cluster. -> **If you are not using Kubernetes service discovery (for example, if you are running without RBAC or outside Kubernetes), you must manually configure service endpoints for the frontend.** See [Running Sourcegraph Without Kubernetes Service Discovery](/admin/deploy/without_service_discovery) for instructions. +If you are not using Kubernetes service discovery (for example, if you are running without RBAC or outside Kubernetes), you must manually configure service endpoints for the frontend.** See [Running Sourcegraph Without Kubernetes Service Discovery](/admin/deploy/without_service_discovery) for instructions. --- From e31cf7f02cc0640cc754db2086e1933c4c3de88c Mon Sep 17 00:00:00 2001 From: Stefan Hengl Date: Tue, 20 May 2025 15:55:51 +0200 Subject: [PATCH 3/5] formatting --- docs/admin/deploy/kubernetes/configure.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/admin/deploy/kubernetes/configure.mdx b/docs/admin/deploy/kubernetes/configure.mdx index 40770c5b5..4f31da053 100644 --- a/docs/admin/deploy/kubernetes/configure.mdx +++ b/docs/admin/deploy/kubernetes/configure.mdx @@ -82,7 +82,7 @@ RBAC must be enabled in your cluster for the frontend to communicate with other This will allow the frontend service to discover endpoints for each service replica and communicate with them through the Kubernetes API. Note that this component should only be added if RBAC is enabled in your cluster. -If you are not using Kubernetes service discovery (for example, if you are running without RBAC or outside Kubernetes), you must manually configure service endpoints for the frontend.** See [Running Sourcegraph Without Kubernetes Service Discovery](/admin/deploy/without_service_discovery) for instructions. +If you are not using Kubernetes service discovery (for example, if you are running without RBAC or outside Kubernetes), you must manually configure service endpoints for the frontend. See [Running Sourcegraph Without Kubernetes Service Discovery](/admin/deploy/without_service_discovery) for instructions. --- From 01f6d3238728f74ae13a56b3b31f858cdc7e8f16 Mon Sep 17 00:00:00 2001 From: Stefan Hengl Date: Tue, 20 May 2025 15:58:01 +0200 Subject: [PATCH 4/5] wording --- docs/admin/deploy/without_service_discovery.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/admin/deploy/without_service_discovery.mdx b/docs/admin/deploy/without_service_discovery.mdx index 700a00204..4c9d930ca 100644 --- a/docs/admin/deploy/without_service_discovery.mdx +++ b/docs/admin/deploy/without_service_discovery.mdx @@ -2,7 +2,7 @@ Not settting these environment variables might prevent pods from starting when running without service discovery. -If you are deploying Sourcegraph in an environment **without Kubernetes service discovery** (for example, using Docker Compose or single-container Docker), you must manually configure the frontend service to know about the other service replicas. This is typically required when you are not using RBAC or the `service-discovery` component in Kubernetes, or when running outside Kubernetes entirely. +If you are deploying Sourcegraph in an environment **without Kubernetes service discovery** (for example, using Docker Compose or single-container Docker), you must manually configure the frontend service to know about the other service replicas. This is typically required when you are not using RBAC, or when running outside Kubernetes entirely. ## Required Environment Variables From 381a5f1d4a51079b7697bd04516a602d8a1fb19f Mon Sep 17 00:00:00 2001 From: Marc <7050295+marcleblanc2@users.noreply.github.com> Date: Tue, 20 May 2025 10:59:48 -0600 Subject: [PATCH 5/5] Sort env vars, and reformat for Docker Compose --- .../deploy/docker-compose/configuration.mdx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/admin/deploy/docker-compose/configuration.mdx b/docs/admin/deploy/docker-compose/configuration.mdx index 77be9f125..ffb3b7fc9 100644 --- a/docs/admin/deploy/docker-compose/configuration.mdx +++ b/docs/admin/deploy/docker-compose/configuration.mdx @@ -125,7 +125,7 @@ If you must use a `.netrc` file to store these credentials instead, follow the p ## Add replicas -When adding replicas for `gitserver`, `indexed-search`, `searcher`, or `symbols`, you must update the corresponding environment variable on each of the frontend services in your docker-compose.override.yaml file, `SRC_GIT_SERVERS`, `INDEXED_SEARCH_SERVERS`, `SEARCHER_URL`, and `SYMBOLS_URL` to the number of replicas for each respective service. Sourcegraph will then automatically infer the endpoints for each replica. +When adding replicas for `gitserver`, `searcher`, `symbols`, `zoekt-indexserver`, or `zoekt-webserver`, you must update the corresponding environment variable on each of the frontend services in your docker-compose.override.yaml file to the number of replicas for the respective service. Sourcegraph will then automatically infer the containers' endpoints for each replica. ```yaml # docker-compose.override.yaml @@ -133,24 +133,24 @@ services: sourcegraph-frontend-0: environment: - - 'SRC_GIT_SERVERS=2' - - 'INDEXED_SEARCH_SERVERS=2' - - 'INDEXED_SEARCH_INDEXERS=2' + - 'INDEXED_SEARCH_INDEXERS=1' + - 'INDEXED_SEARCH_SERVERS=1' - 'SEARCHER_URL=1' + - 'SRC_GIT_SERVERS=1' - 'SYMBOLS_URL=1' sourcegraph-frontend-internal: environment: - - 'SRC_GIT_SERVERS=2' - - 'INDEXED_SEARCH_SERVERS=2' - - 'INDEXED_SEARCH_INDEXERS=2' + - 'INDEXED_SEARCH_INDEXERS=1' + - 'INDEXED_SEARCH_SERVERS=1' - 'SEARCHER_URL=1' + - 'SRC_GIT_SERVERS=1' - 'SYMBOLS_URL=1' ``` ## Shard gitserver -If you find that your gitserver container is performing poorly, you can shard it into multiple containers. This is especially helpful when your Docker Compose host can mount multiple storage volumes, and each gitserver shared can use its own storage IOPS limit. +If you find that your gitserver container is performing poorly, you can shard it into multiple containers. This is especially helpful when your Docker Compose host can mount multiple storage volumes, and each gitserver shard can use its own storage IOPS limit. To split gitserver across multiple shards: