docs: add high availability (#4583)

- Rename `CODER_DERP_SERVER_RELAY_ADDRESS`

Co-authored-by: Ammar Bandukwala <ammar@ammar.io>
This commit is contained in:
Kyle Carberry 2022-10-17 14:27:38 -05:00 committed by GitHub
parent fda71dadcb
commit 4e44716b0c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 102 additions and 23 deletions

View File

@ -88,7 +88,7 @@ func Flags() *codersdk.DeploymentFlags {
DerpServerRelayAddress: &codersdk.StringFlag{
Name: "DERP Server Relay Address",
Flag: "derp-server-relay-address",
EnvVar: "CODER_DERP_SERVER_RELAY_ADDRESS",
EnvVar: "CODER_DERP_SERVER_RELAY_URL",
Description: "An HTTP address that is accessible by other replicas to relay DERP traffic. Required for high availability.",
Enterprise: true,
},

View File

@ -3,28 +3,32 @@
Coder is free to use and includes some features that are only accessible with a paid license.
Contact sales@coder.com to obtain a license.
These features are available in the enterprise edition:
- [Audit Logging](./audit-logs.md)
- [Browser Only Connections](../networking.md#browser-only-connections)
### User Management
- [Groups](./groups.md)
- [Template RBAC](./rbac.md)
- [Quotas](./quotas.md)
- [SCIM](./auth.md#scim)
And we're releasing these imminently:
### Networking & Deployment
- [High Availability](./high-availability.md)
- [Browser Only Connections](../networking.md#browser-only-connections)
### Other
- [Audit Logging](./audit-logs.md)
- [Quotas](./quotas.md)
### Coming soon
- High Availability
- Multiple Git Provider Authentication
- Max Workspace Auto-Stop
## Adding your license key
### You will need:
### Requirements
- Your license key (contact sales@coder.com if you don't have yours)
- Coder CLI installed
### Steps:
### Instructions
1. Save your license key to disk and make note of the path
2. Open a terminal

View File

@ -0,0 +1,63 @@
# High Availability
High Availability (HA) mode solves for horizontal scalability and automatic failover
within a single region. When in HA mode, Coder continues using a single Postgres
endpoint. [GCP](https://cloud.google.com/sql/docs/postgres/high-availability), [AWS](https://docs.aws.amazon.com/prescriptive-guidance/latest/saas-multitenant-managed-postgresql/availability.html),
and other cloud vendors offer fully-managed HA Postgres services that pair
nicely with Coder.
For Coder to operate correctly, every node must be within 10ms of each other
and Postgres. We make a best-effort attempt to warn the user when inter-coder
latency is too high, but if requests start dropping, this is one metric to investigate.
Note that this latency requirement applies _only_ to coder services. Coder will
operate correctly even with few seconds of latency on
workspace <-> coder and user <-> coder connections.
## Setup
Coder automatically enters HA mode when multiple instances simultaneously connect
to the same Postgres endpoint.
HA brings one configuration variable to set in each Coder
node: `CODER_DERP_SERVER_RELAY_URL`. The HA nodes use these URLs to communicate
with each other. Inter-node communication is only required while using the
embedded relay (default). If you're using [custom relays](../networking.md#custom-relays), Coder ignores `CODER_DERP_SERVER_RELAY_URL` since Postgres is the sole rendezvous for the Coder nodes.
`CODER_DERP_SERVER_RELAY_URL` will never be `CODER_ACCESS_URL` because
`CODER_ACCESS_URL` is a load balancer to all Coder nodes.
Here's an example 3-node network configuration setup:
| Name | `CODER_ADDRESS` | `CODER_DERP_SERVER_RELAY_URL` | `CODER_ACCESS_URL` |
| ------- | --------------- | ----------------------------- | ----------------------- |
| `coder-1` | `*:80` | `http://10.0.0.1:80` | `https://coder.big.corp` |
| `coder-2` | `*:80` | `http://10.0.0.2:80` | `https://coder.big.corp` |
| `coder-3` | `*:80` | `http://10.0.0.3:80` | `https://coder.big.corp` |
## Kubernetes
If you installed Coder via
[our Helm Chart](../install/kubernetes.md#install-coder-with-helm), just
increase `coder.replicaCount` in `values.yaml`.
If you installed Coder into Kubernetes by some other means, insert the relay URL
via the environment like so:
```yaml
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: CODER_DERP_SERVER_RELAY_URL
value: http://$(POD_IP)
```
Then, increase the number of pods.
## Up next
- [Networking](../networking.md)
- [Kubernetes](../install/kubernetes.md)
- [Enterprise](./enterprise.md)

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated by Pixelmator Pro 3.0.1 -->
<svg viewBox="0 0 138 138" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<path id="Path" fill="#000000" stroke="none" d="M 135.967728 121.080605 C 132.566254 122.586487 128.582581 121.04834 127.073204 117.654724 C 125.569221 114.261108 127.105545 110.286659 130.507034 108.780777 C 132.280548 108.000946 134.205002 108.038589 135.859924 108.737747 L 133.644379 102.741112 C 133.21312 101.531029 131.865463 100.917923 130.663361 101.38044 L 126.048988 103.165985 C 122.351013 104.171692 116.642349 104.634216 112.006409 103.908173 C 95.122971 101.28363 86.659683 109.254051 86.659683 109.254051 C 90.407791 110.18071 95.4049 111.830727 98.753555 114.378891 C 92.938148 116.129478 86.601463 117.196503 80.19471 116.272003 C 76.099449 114.627365 72.960495 111.947433 72.023598 105.451164 C 72.023598 105.451164 68.540718 107.892838 68.064194 111.789307 C 66.675568 110.915359 60.509766 105.888397 58.867783 104.597649 C 55.735828 100.805511 53.797356 97.784065 54.284676 92.254791 C 54.284676 92.254791 49.793205 93.676773 49.044445 97.66037 C 44.618744 94.935257 40.509472 93.001816 36.567303 91.773979 C 34.793251 91.2211 33.049381 90.809677 31.336781 90.53701 C 36.972141 85.646118 49.985107 76.365578 68.981133 74.78978 C 70.753571 74.78064 72.413879 74.830658 73.937813 74.914551 C 73.134071 76.638786 72.989059 78.214584 74.298439 79.900101 C 77.462746 83.971359 87.661804 81.545815 99.310944 94.964302 L 104.1679 90.274551 C 103.364693 90.274551 102.545319 90.129341 101.752899 89.822792 C 98.275948 88.489014 96.550941 84.59523 97.887825 81.12632 C 99.23008 77.662796 103.132896 75.936401 106.604462 77.275558 C 108.410316 77.974724 109.7472 79.362289 110.415627 81.024139 L 113.100166 75.215729 C 113.650002 74.059433 113.137894 72.671867 111.957352 72.150185 L 107.423843 70.160271 C 104.10321 68.26178 99.736801 64.561615 96.97142 60.780777 C 86.890945 47.012703 75.257973 46.673874 75.257973 46.673874 C 77.774857 50.832802 80.880936 57.213982 80.212502 61.951057 C 79.211998 61.834885 78.118782 61.72464 76.93338 61.630524 C 72.674789 60.905006 68.520767 60.611359 64.523087 60.633415 C 60.077976 60.244568 56.819881 58.63166 54.642609 53.987091 C 54.642609 53.987091 52.381241 57.67543 53.833477 61.436371 C 42.256569 63.102524 32.809498 66.989845 27.311602 69.699898 C 35.280563 57.729744 46.339428 48.18837 60.418663 41.180099 C 68.755272 37.030853 76.851982 34.478928 83.365479 32.916573 C 83.052818 35.253914 83.315887 37.089485 85.446259 38.348503 C 89.88813 40.978416 98.480789 34.981781 114.259148 43.199593 L 117.046097 37.052376 C 116.302193 37.348167 115.488213 37.514885 114.63649 37.520271 C 110.916962 37.547165 107.876648 34.5569 107.844307 30.845985 C 107.817352 27.129677 110.809151 24.096397 114.534065 24.069511 C 116.469307 24.053375 118.215866 24.84935 119.455711 26.145485 L 119.811493 19.777748 C 119.897743 18.497749 118.911263 17.395226 117.622902 17.341446 L 112.674301 17.147827 C 108.884697 16.604637 103.461723 14.759933 99.494225 12.259094 C 91.564079 7.253113 85.171875 6 80.320313 6 C 76.553337 6 74.110313 7.096069 74.110313 7.096069 C 77.736588 9.851288 82.557419 14.232872 84.077576 18.597244 C 82.304604 18.847328 78.493965 19.464203 73.385269 20.71785 C 66.091217 21.161545 62.336109 20.834015 56.929852 15.970016 C 56.929852 15.970016 56.267342 21.13842 58.802555 25.170425 C 57.087257 25.799667 55.326679 26.483765 53.531063 27.229172 C 49.115601 28.540909 44.250561 28.951263 39.70303 24.2556 C 39.70303 24.2556 38.528954 29.809608 41.285717 33.094048 C 38.941334 34.379433 36.586174 35.774521 34.242329 37.286858 C 28.432312 39.500511 24.846468 39.898483 19.958248 37.572441 C 19.958248 37.572441 20.096249 42.090622 23.612555 45.114761 C 21.040688 47.276237 18.531889 49.608734 16.11743 52.124641 C 11.595235 55.454788 8.103727 56.809006 3.745945 55.610756 C 3.745945 55.610756 4.91625 60.02784 8.566242 61.079796 C 5.296828 65.515167 2.540601 70.415733 0 75.801941 L 0 131.196899 C 1.655461 128.536865 4.509258 123.989113 7.155516 121.156441 C 15.870539 111.825882 29.616634 108.132706 42.774071 114.612839 C 52.199577 119.254715 62.450928 126.022591 72.995529 128.476639 C 77.158707 129.593689 81.24588 130.037384 85.12336 130.037384 C 92.889633 130.037384 99.81443 128.264206 104.829865 126.590523 C 105.589409 130.240662 106.191002 133.005585 109.526718 133.428848 C 114.647812 134.074219 120.248672 125.162621 138 126.431862 L 138 119.698425 C 137.428589 120.263123 136.749374 120.736404 135.967728 121.080605 Z"/>
</svg>

After

Width:  |  Height:  |  Size: 4.5 KiB

View File

@ -27,17 +27,17 @@
"children": [
{
"title": "Install script",
"description": "One-line install script for macOS and Linux.",
"description": "One-line install script for macOS and Linux",
"path": "./install/install.sh.md"
},
{
"title": "System packages",
"description": "System packages for Debian, Ubuntu, Fedora, CentOS, RHEL, SUSE, and Alpine.",
"description": "System packages for Debian, Ubuntu, Fedora, CentOS, RHEL, SUSE, and Alpine",
"path": "./install/packages.md"
},
{
"title": "Kubernetes",
"description": "Install Coder with Kubernetes via Helm.",
"description": "Install Coder with Kubernetes via Helm",
"path": "./install/kubernetes.md"
},
{
@ -47,12 +47,12 @@
},
{
"title": "Standalone binaries",
"description": "Download binaries for macOS, Windows, and Linux.",
"description": "Download binaries for macOS, Windows, and Linux",
"path": "./install/binary.md"
},
{
"title": "Uninstall",
"description": "Learn how to uninstall Coder.",
"description": "Learn how to uninstall Coder",
"path": "./install/uninstall.md"
}
]
@ -182,7 +182,7 @@
"children": [
{
"title": "Authentication",
"description": "Learn how to set up authentication using GitHub or OpenID Connect.",
"description": "Learn how to set up authentication using GitHub or OpenID Connect",
"icon_path": "./images/icons/key.svg",
"path": "./admin/auth.md"
},
@ -208,13 +208,13 @@
},
{
"title": "Configuration",
"description": "Learn how to configure Coder.",
"description": "Learn how to configure Coder",
"path": "./admin/configure.md",
"icon_path": "./images/icons/toggle_on.svg"
},
{
"title": "Upgrading",
"description": "Learn how to upgrade Coder.",
"description": "Learn how to upgrade Coder",
"icon_path": "./images/icons/upgrade.svg",
"path": "./admin/upgrade.md"
},
@ -226,27 +226,34 @@
},
{
"title": "Audit Logs",
"description": "Learn how to use Audit Logs in your Coder deployment.",
"description": "Learn how to use Audit Logs in your Coder deployment",
"icon_path": "./images/icons/radar.svg",
"path": "./admin/audit-logs.md",
"state": "enterprise"
},
{
"title": "Quotas",
"description": "Learn how to use Workspace Quotas in Coder.",
"description": "Learn how to use Workspace Quotas in Coder",
"icon_path": "./images/icons/dollar.svg",
"path": "./admin/quotas.md",
"state": "enterprise"
},
{
"title": "High Availability",
"description": "Learn how to configure Coder for High Availability",
"icon_path": "./images/icons/hydra.svg",
"path": "./admin/high-availability.md",
"state": "enterprise"
},
{
"title": "Enterprise",
"description": "Learn how to enable Enterprise features.",
"description": "Learn how to enable Enterprise features",
"icon_path": "./images/icons/group.svg",
"path": "./admin/enterprise.md"
},
{
"title": "Telemetry",
"description": "Learn what usage telemetry Coder collects.",
"description": "Learn what usage telemetry Coder collects",
"icon_path": "./images/icons/science.svg",
"path": "./admin/telemetry.md"
}

View File

@ -40,7 +40,7 @@ spec:
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: CODER_DERP_SERVER_RELAY_ADDRESS
- name: CODER_DERP_SERVER_RELAY_URL
value: "{{ include "coder.portName" . }}://$(KUBE_POD_IP):{{ include "coder.port" . }}"
{{- include "coder.tlsEnv" . | nindent 12 }}
{{- with .Values.coder.env -}}