Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

distribution: architecture, security, cost estimation, creation, operations, and more #1284

Merged
merged 5 commits into from
Jul 28, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
fixup!
  • Loading branch information
slimsag committed Jul 28, 2020
commit 3b23bdd3e9cfefe29cd73f06dcf863fd8578c96d
22 changes: 22 additions & 0 deletions handbook/engineering/distribution/managed/creation_process.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,25 @@ Creating a new managed instance involves following the steps below.
1. Configure `externalURL` in the site configuration, and use SSH to restart the server (`sudo su`, `shutdown -r`) wait for it to come back up and access it again.
1. In the global user settings, set `"alerts.showPatchUpdates": false`
1. In the GCP web UI under **Network services** > **Load balancers** > select the load balancer > watch the SSL certificate status. It may take some time for it to become active (~1h41m) / for Google to see the DNS change from Cloudflare. Confirm it is active by following ["Access through the GCP load balancer as a user would"](#access-through-the-gcp-load-balancer-as-a-user-would).
1. In the site configuration, configure alerting to go to our `#alerts-managed-instances` Slack channel, for example (replace `$COMPANY` with the actual company name, and `$WEBHOOK_URL` with the actual webhook URL from 1password **Managed instances** > `#alerts-managed-instances Slack webhook URL`):

```
"observability.alerts": [
{
"level": "critical",
"notifier": {
"type": "slack",
"username": "$COMPANY",
"url": "$WEBHOOK_URL"
}
},
{
"level": "warning",
"notifier": {
"type": "slack",
"username": "$COMPANY",
"url": "$WEBHOOK_URL"
}
}
],
```
18 changes: 17 additions & 1 deletion handbook/engineering/distribution/managed/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,25 @@ During an upgrade, both `default-red-instance` and `default-black-instance` woul
Locate the GCP instance you'd like to access (usually either `default-red-instance` or `default-black-instance`), and then:

```sh
gcloud beta compute ssh --zone "us-central1-f" --tunnel-through-iap --project "sourcegraph-managed-$COMPANY" default-red-instance
$ gcloud beta compute ssh --zone "us-central1-f" --tunnel-through-iap --project "sourcegraph-managed-$COMPANY" default-red-instance
```

If you get an error:

```sh
ERROR: (gcloud.beta.compute.start-iap-tunnel) Error while connecting [4003: u'failed to connect to backend'].
ssh_exchange_identification: Connection closed by remote host
ERROR: (gcloud.beta.compute.ssh) [/usr/bin/ssh] exited with return code [255].
```

This may be indicating that the VM is currently not running - check:

```sh
$ gcloud beta compute instances list --project=sourcegraph-managed-$COMPANY
```

And start the instance if needed (e.g. through the web UI.)

## Port-forwarding (direct access to Caddy, Jaeger, and Grafana)

Locate the GCP instance you'd like to access (usually either `default-red-instance` or `default-black-instance`), and then:
Expand Down