Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions docs/admin/pings.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
50 changes: 3 additions & 47 deletions docs/self-hosted/private-network.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -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'
```

<Callout type="info">
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'
```

</Callout>
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:
<service-name>:
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'
```

<Callout type="warning">
Failure to configure `NO_PROXY` correctly can cause the proxy configuration
to interfere with local networking between internal Sourcegraph services.
</Callout>
- [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

Expand Down
Loading