diff --git a/docs/admin/pings.mdx b/docs/admin/pings.mdx index 5613b3497..74135dbcb 100644 --- a/docs/admin/pings.mdx +++ b/docs/admin/pings.mdx @@ -206,9 +206,7 @@ Refer to [outbound access to Sourcegraph services](/self-hosted/private-network# ## Using an HTTP proxy for ping requests -The environment variable `TELEMETRY_HTTP_PROXY` can be set on the `sourcegraph-frontend` service, to use an HTTP proxy for ping requests. - -Be sure to update the environment variable like so : `TELEMETRY_HTTP_PROXY:"http://proxy.example.com:8080"` +Refer to [HTTP proxy configuration](/self-hosted/private-network#http-proxy-configuration) to route pings and all other outbound requests through a proxy. ## Connections to Sourcegraph-managed services diff --git a/docs/self-hosted/private-network.mdx b/docs/self-hosted/private-network.mdx index f7431f9cc..4ee09a498 100644 --- a/docs/self-hosted/private-network.mdx +++ b/docs/self-hosted/private-network.mdx @@ -32,54 +32,10 @@ To ensure a smooth experience, instances must allow **outbound TCP port `443` to ## HTTP proxy configuration -All Sourcegraph services respect the conventional `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` environment variables for -routing Sourcegraph client application HTTP traffic through a proxy server. The steps for configuring proxy environment -variables will depend on your Sourcegraph deployment method. - -### Kubernetes Helm - -Add the proxy environment variables to your Sourcegraph Helm chart [override file](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/charts/sourcegraph/values.yaml): - -```yaml -executor|frontend|gitserver|migrator|worker: - env: - HTTP_PROXY: - value: http://proxy.example.com:8080 - HTTPS_PROXY: - value: http://proxy.example.com:8080 - NO_PROXY: - value: 'blobstore,codeinsights-db,codeintel-db,sourcegraph-frontend-internal,sourcegraph-frontend,gitserver,grafana,indexed-search-indexer,indexed-search,jaeger-query,pgsql,precise-code-intel-worker,prometheus,redis-cache,redis-store,searcher,syntect-server,worker-executors,worker,cloud-sql-proxy,localhost,127.0.0.1,.svc,.svc.cluster.local,kubernetes.default.svc' -``` - - -If the updated Sourcegraph pods fail to pass their readiness or health checks after configuring the HTTP proxy environment variables, you may also need to add your k8s cluster pod & service CIDR ranges to the `NO_PROXY` environment variable. For example, if the k8s cluster pod & service CIDR ranges are `10.10.0.0/16` and `10.20.0.0/16`, configure the `NO_PROXY` environment variable as: - -```yaml -executor|frontend|gitserver|migrator|worker: - env: - NO_PROXY: - value: 'blobstore,codeinsights-db,codeintel-db,sourcegraph-frontend-internal,sourcegraph-frontend,gitserver,grafana,indexed-search-indexer,indexed-search,jaeger-query,pgsql,precise-code-intel-worker,prometheus,redis-cache,redis-store,searcher,syntect-server,worker-executors,worker,cloud-sql-proxy,localhost,127.0.0.1,.svc,.svc.cluster.local,kubernetes.default.svc,10.10.0.0/16,10.20.0.0/16' -``` - - +Sourcegraph services use the conventional `HTTP_PROXY`, `HTTPS_PROXY`, and `NO_PROXY` environment variables. Set them on the `frontend` and `worker` services, using the example override file for your deployment method: -### Docker Compose - -Add the proxy environment variables your docker compose override file. - -```yaml -services: - : - environment: - - HTTP_PROXY=http://proxy.example.com:8080 - - HTTPS_PROXY=http://proxy.example.com:8080 - - NO_PROXY='blobstore,caddy,cadvisor,codeintel-db,codeintel-db-exporter,codeinsights-db,codeinsights-db-exporter,sourcegraph-frontend-0,sourcegraph-frontend-internal,gitserver-0,grafana,migrator,node-exporter,otel-collector,pgsql,pgsql-exporter,precise-code-intel-worker,prometheus,redis-cache,redis-store,searcher-0,syntect-server,worker,zoekt-indexserver-0,zoekt-webserver-0,localhost,127.0.0.1' -``` - - - Failure to configure `NO_PROXY` correctly can cause the proxy configuration - to interfere with local networking between internal Sourcegraph services. - +- [Kubernetes Helm](https://github.com/sourcegraph/deploy-sourcegraph-helm/blob/main/charts/sourcegraph/examples/outbound-http-proxy/override.yaml) +- [Docker Compose](https://github.com/sourcegraph/deploy-sourcegraph-docker/blob/main/docker-compose/examples/outbound-http-proxy/docker-compose.override.yaml) ## Docker networking configuration