Adds `Coder.AbbreviationFirstUse`, a Vale rule that requires each abbreviation to be expanded on its first use on a page, in the form "Expanded Form (ABBR)". It supports [WCAG 2.2 Level AAA Success Criterion 3.1.4 (Abbreviations)](https://www.w3.org/TR/WCAG22/#abbreviations). Following the "Adding a Vale rule" pattern in `docs/.style/README.md`, the PR has two commits: the cleanup first, then the enable. ## Cleanup commit 431 first uses expanded across 167 pages, so the rule ships with zero findings across `docs/`, excluding `docs/.style/style-guide/`. The branch was rebuilt on current `main`, so pages added or moved since the first draft are covered. - Where the first use is a bold UI label (**CA Path**, **Add redirect URI**, **Redirect URI**), the label stays as the UI shows it and the expansion goes elsewhere in the same paragraph or list item. - Reversed forms such as "PKCE (Proof Key for Code Exchange)" are flipped to the expanded-first form. - A few sentences took a small rewording to fit the expansion: list steps that would pass the 20-word limit (`Coder.StepLength`), and spots where the expansion would nest parentheses. - MITM is expanded as "machine-in-the-middle" rather than "man-in-the-middle". Every use describes the AI Gateway Proxy intercepting traffic on purpose, so "on-path attacker" doesn't fit. The inclusive-language table on `accessibility-and-inclusion.md` gains the substitution: "on-path attacker" for the attack, "machine-in-the-middle" for the feature. - Unrelated fixes on lines already being edited: `DERP MAP` → `DERP map`, and `ENV` → "environment variable" in `faqs.md`. ## Enable commit **Rule design.** The rule is a `conditional`. `first` matches 2 to 6 capitals, each optionally followed by digits (`EC2`, `P2P`), and a lookahead lets a plural `s` count as a use of the singular. `second` captures the abbreviation in `word (ABBR)`, including `(CI/CD)` and `(PCI DSS)` pairs. Vale collects the captures across the page's blocks in document order, so a later expansion doesn't cover an earlier use. Within a single paragraph, list item, or table cell, an expansion anywhere in the block counts. **Scope.** `scope: ~heading` skips headings, because a page title often names an abbreviation that the first paragraph then expands. Vale already skips front matter, code blocks, inline code, and link URLs. `.vale.ini` turns the rule off for the pages generated from Go source that `Coder.UnitSpacing` already skips: `docs/reference/{api,cli}/*.md`, `configuration-reference.md`, and `prometheus.md`. **Severity: `warning`.** Whether an abbreviation is familiar enough to skip is a judgment call, so this is guidance with legitimate exceptions, not hard policy. **Exceptions**, each group commented in the rule file: | Group | Entries | Reason | | --- | --- | --- | | Known to every reader | AI, API, AWS, CLI, CPU, DNS, GCP, HTTP(S), ID, IDE, IP, JSON, OS, PR, RAM, SDK, SQL, SSH, TLS, UI, URL, VM, YAML | Abbreviations every reader of the docs knows. Plurals such as VMs and SDKs pass too | | Units, clock times, file and package formats | GB, KB, MB, AM, PM, CSV, GIF, JPEG, PDF, PNG, RPM, SVG, VSIX, ZIP | Readers know these by the abbreviation, not the expansion | | Not abbreviations | NOTE, TIP, OK, README, SKILL, ALL, AND, ANY, ERROR, MUST, NOT, ON, OR, DELETE, GET, POST, PUT, ILIKE, VACUUM, LOGIN, PLAIN, NUL, CRON, TERM, DOCS, `DOC\d+`, `RFC\d+`, TL, DR | Alert labels, file names, emphasis in capitals, HTTP methods, SQL keywords, SMTP auth mechanisms, rule labels in `docs/AGENTS.md`, RFC numbers, TL;DR | | Names written in capitals | VS, IDEA, IU, NGINX, SUSE, GNU, XFCE, DX, IBM, DCV, TRAMP, MSYS2, NET, VSX, ARM, AMD, GPT, AES, GCM, HMAC, HS256, RSA, SHA, SHA256 | The capitals are the product, company, or algorithm name (VS Code, IntelliJ IDEA, .NET, Open VSX, Amazon DCV, AMD) | The "known to every reader" group is the list that needs judgment, and it's the one to push back on. The other groups only stop the regex from treating words and names as abbreviations. **Documentation.** A new "Expand abbreviations on first use" section on `accessibility-and-inclusion.md`, and the style guide README's checks table, coverage table, and rule counts (90 → 91 rules, 22 → 23 tool-checked). ## Known limits - The rule checks that an expansion exists, not that it's correct: any word followed by `(ABBR)` satisfies it. - An abbreviation in an image's alt text is checked before the paragraph around it, so one alt text (`aws-marketplace.md`) carries its own expansion. - Some expansions read heavily in dense table cells and inline lists, for example the four Kubernetes services in `docker-in-workspaces.md`. They're correct, but a reviewer may prefer adding a specific abbreviation to the exceptions instead. ## Testing - `vale docs/` (Vale 3.7.1 through mise): zero `Coder.AbbreviationFirstUse` findings. Findings from every other rule match `main` file for file. - `pnpm run format-docs`, `pnpm run lint-docs`, `scripts/check_emdash.sh`, and `make lint/prose` run clean, and the repository pre-commit hooks (including `lint/style-claims`) pass on both commits. Linear: DOCS-1311 Generated by Coder Agents on behalf of @nickvigilante.
4.6 KiB
title
| title |
|---|
| 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, AWS, and other cloud vendors offer fully-managed HA Postgres services that pair nicely with Coder.
For Coder to operate correctly, coderd instances should have low-latency connections to each other so that they can effectively relay traffic between users and workspaces no matter which coderd instance users or workspaces connect to.
We make a best-effort attempt to warn the user when inter-coderd latency is too high, but if requests start dropping, this is one metric to investigate.
We also recommend that you deploy all coderd instances such that they have low-latency connections to Postgres.
coderd often makes several database round-trips while processing a single API request, so prioritizing low-latency between coderd and Postgres is more important than low-latency between users and coderd.
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.
Note
When upgrading HA deployments, database migrations may require special handling to avoid lock contention. See Upgrading Best Practices for recommended procedures.
HA brings one configuration variable to set in each coderd 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, 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.
Coder also clusters its inter-node pubsub across HA nodes and needs each replica's routable address to do so.
This address comes from CODER_CLUSTER_HOST, falling back to the host in CODER_DERP_SERVER_RELAY_URL when it is unset.
Set CODER_CLUSTER_HOST to each node's routable IP address.
Setting it is required when you use custom relays, because CODER_DERP_SERVER_RELAY_URL is ignored and no fallback address is available.
If a node has neither value set, Coder logs an error and falls back to PostgreSQL for pubsub.
Nodes connect to each other's pubsub on Transmission Control Protocol (TCP) port 6222, which isn't configurable.
Allow port 6222 between the CODER_CLUSTER_HOST addresses of your coderd nodes in any firewall or Kubernetes NetworkPolicy that sits between them.
If you use the embedded relay, also allow the port in CODER_DERP_SERVER_RELAY_URL.
If port 6222 is blocked, Coder doesn't fall back to PostgreSQL, so events published on one node, such as workspace updates, don't reach clients connected to another node.
Here's an example 3-node network configuration setup:
| Name | CODER_HTTP_ADDRESS |
CODER_DERP_SERVER_RELAY_URL |
CODER_CLUSTER_HOST |
CODER_ACCESS_URL |
|---|---|---|---|---|
coder-1 |
*:80 |
http://10.0.0.1:80 |
10.0.0.1 |
https://coder.big.corp |
coder-2 |
*:80 |
http://10.0.0.2:80 |
10.0.0.2 |
https://coder.big.corp |
coder-3 |
*:80 |
http://10.0.0.3:80 |
10.0.0.3 |
https://coder.big.corp |
Kubernetes
If you installed Coder via our Helm Chart, 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:
env:
- name: POD_IP
valueFrom:
fieldRef:
fieldPath: status.podIP
- name: CODER_DERP_SERVER_RELAY_URL
value: http://$(POD_IP)
- name: CODER_CLUSTER_HOST
value: $(POD_IP)
Then, increase the number of pods.