Skip to content
This repository was archived by the owner on Jul 2, 2024. It is now read-only.
Merged
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
Original file line number Diff line number Diff line change
@@ -1,17 +1,42 @@
# Add or modify DNS records to Sourcegraph owned domains

Sourcegraph follows an Infrastructure as Code (IaC) model. To make changes to Sourcegraph
owned DNS records you should make the change to the code in Terraform in our infrastructure repo.
owned DNS records you should make the change to the code in Terraform in our [sourcegraph/infrastructure] repo.

1. Clone [sourcegraph/infrastructure]
1. Navigate to the `dns` folder
1. Create a file, add the record near the most relevant DNS entries, or modify the existing record

1. For domains with a large number of TXT records like
Sourcegraph.com, we typically create a file `sourcegraph.$TXT_PROVIDER.tf`

1. Create a pull request in the infra repo with your changes
1. Create a pull request in the repo with your changes
1. Open [Buildkite](https://buildkite.com/sourcegraph/infrastructure)

1. Check status of `ci/terraform.sh dns` job and it should pass without error.
1. If there is any error, you should consult the logs or reach out to `#cloud-devops`

1. Wait for Buildkite to finish your build
1. Get approve from the cloud-devops team
1. `terraform apply` the PR or ask a member of the devops team to do this
1. Merge the PR **after** the apply succeeds

For other
## FAQ

### Are you adding a DNS record for a Netlify site?

You should create a CNAME record pointing to `sourcegraph.netlifyglobalcdn.com`. In terraform, it looks something like

[example](https://github.com/sourcegraph/infrastructure/blob/621b30a24f448f78509b75600d4338491a7ec127/dns/sourcegraph.tf#L48-L54)

```tf
resource "cloudflare_record" "about-sourcegraph-com" {
zone_id = data.cloudflare_zones.sourcegraph_com.zones[0].id
name = "about"
type = "CNAME"
value = var.netlify-enterprise-cdn-cname
proxied = false
}
```

[sourcegraph/infrastructure]: https://github.com/sourcegraph/infrastructure
Original file line number Diff line number Diff line change
Expand Up @@ -167,27 +167,23 @@ See an [example query](https://console.cloud.google.com/bigquery?sq=527047051561

**Note**: This method only permits read-only access

### Restarting about.sourcegraph.com and docs.sourcegraph.com
### Restarting docs.sourcegraph.com

To restart the services powering about.sourcegraph.com and docs.sourcegraph.com:
To restart the services powering docs.sourcegraph.com:

1. List the active pods with `kubectl get pods`. This should produce a list that includes items like the following:
Configure kubectl context to the dotcom cluster

```
NAME READY STATUS RESTARTS AGE
about-sourcegraph-com-74f96c659b-t6lqp 1/1 Running 0 7m49s
docs-sourcegraph-com-5f97dd5db-7wrxm 1/1 Running 0 7m49s
```

The exact names will differ, but the general format will be the same.
```sh
gcloud container clusters get-credentials cloud --zone us-central1-f --project sourcegraph-dev
```

1. Delete the pods, being careful to copy the exact names from the output in the previous step. For example, with that output, you would run:
Rollout a restart

```
kubectl delete pod about-sourcegraph-com-74f96c659b-t6lqp docs-sourcegraph-com-5f97dd5db-7wrxm
```
```sh
kubectl -n default rollout restart deploy docs-sourcegraph-com
```

1. Wait a moment, and check https://about.sourcegraph.com/ and https://docs.sourcegraph.com/.
Wait a moment, and check https://docs.sourcegraph.com/.

### Creating banners for maintenance tasks

Expand Down