chore: modify replicasync to handle NATS explicitly (#26666)

relates to GRU-69

Modifies replicasync to handle discovering NATS enabled primary replicas explicitly, and passing that info to the NATS Pubsub.

This PR adds a new deployment value to explicitly represent the host or IP that the replica can be reached on. It isn't wired up to the CLI, but piggybacks on the DERP config for now.

We learn the NATS port directly from NATS at runtime, and propagate it thru replicasync to learn all peers for clustering.
This commit is contained in:
Spike Curtis
2026-06-26 08:36:32 -04:00
committed by GitHub
parent 9f211ce5ae
commit 98e1ce133c
16 changed files with 219 additions and 132 deletions
+3
View File
@@ -233,6 +233,9 @@ curl -X GET http://coder-server:8080/api/v2/deployment/config \
"browser_only": true,
"cache_directory": "string",
"cli_upgrade_message": "string",
"cluster": {
"host": "string"
},
"config": "string",
"config_ssh": {
"deploymentName": "string",
+21
View File
@@ -3987,6 +3987,20 @@ AuthorizationObject can represent a "set" of objects, such as: all workspaces in
|-----------------------------------------------------------------------------------------------------------------------------------|
| `action_required`, `context_dirty`, `created`, `deleted`, `diff_status_change`, `status_change`, `summary_change`, `title_change` |
## codersdk.ClusterConfig
```json
{
"host": "string"
}
```
### Properties
| Name | Type | Required | Restrictions | Description |
|--------|--------|----------|--------------|-------------|
| `host` | string | false | | |
## codersdk.ConnectionLatency
```json
@@ -5578,6 +5592,9 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
"browser_only": true,
"cache_directory": "string",
"cli_upgrade_message": "string",
"cluster": {
"host": "string"
},
"config": "string",
"config_ssh": {
"deploymentName": "string",
@@ -6180,6 +6197,9 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
"browser_only": true,
"cache_directory": "string",
"cli_upgrade_message": "string",
"cluster": {
"host": "string"
},
"config": "string",
"config_ssh": {
"deploymentName": "string",
@@ -6607,6 +6627,7 @@ CreateWorkspaceRequest provides options for creating a new workspace. Only one o
| `browser_only` | boolean | false | | |
| `cache_directory` | string | false | | |
| `cli_upgrade_message` | string | false | | |
| `cluster` | [codersdk.ClusterConfig](#codersdkclusterconfig) | false | | |
| `config` | string | false | | |
| `config_ssh` | [codersdk.SSHConfig](#codersdksshconfig) | false | | |
| `dangerous` | [codersdk.DangerousConfig](#codersdkdangerousconfig) | false | | |