docs: cover gateway clustering and the proxy modes left untested - #1135
Open
kvinwang wants to merge 1 commit into
Open
docs: cover gateway clustering and the proxy modes left untested#1135kvinwang wants to merge 1 commit into
kvinwang wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1134. I tested a two-node gateway cluster after that merged; this adds what it turned up and corrects a claim the first version made about proxy coverage.
Gateway clustering (new section 6)
Two things about clustering are easy to get wrong and hard to diagnose.
Sync is already on in a single-node run.
entrypoint.shsetsSYNC_ENABLED=$([ "$NODE_ID" -gt 0 ] && ...), so a node withNODE_ID=1logsWaveKV: detected certificate changesand looks clustered while nothing has ever replicated. I had assumed the opposite — that sync was off in my single-node runs — and said so before checking the entrypoint. Neither reading is safe without looking, so the section says which it is and why the log line is not evidence.Every node must deploy under the same
--name. Cluster members require the peer'sapp_idto equal their own (kv/https_client.rs), which is deliberate — it confines WaveKV replication to instances of one authorized compose rather than letting any CVM join.app_idis the compose hash andnameis part of it, so a second node deployed under a different name fails discovery with:That reads like a trust or connectivity fault and is neither. Per-node values (
NODE_ID, WireGuard addressing, ports,MY_URL,BOOTNODE_URL) belong in--env-file, whose values are encrypted at deploy time and excluded from the hash — only the key names are recorded, asallowed_envs. Diffing the two compose files showednameas the only differing field, which is what made the cause obvious; the section suggests comparing the two hashes before deploying.The section also lists what actually proves a cluster works, because agreeing peer lists are the weakest of the available signals. The one that matters is traffic entering node2 and reaching an app whose WireGuard tunnel terminates on node1 — that shows what replicated is usable routing state, not metadata that happens to match.
Correction to what is now section 7
The merged version listed "
curlthrough the proxy to the app — end to end, including TLS termination and routing". That is true but invites the reading that the proxy is covered, and it is not.Ingress maps as
<id>[-[<port>][s|g]].<base_domain>, and the suffixes select different code paths:sis TLS passthrough throughproxy/tls_passthough.rswith its own_dstack-app-addressTXT resolution,gis HTTP/2. The 0.6.0-rc0 round exercised only the no-suffix path, single-node and then across a cluster, and only with a small request — no sustained transfer, long-lived connection or streaming. The table row now says so and a subsection spells out what remains untested.One diagnostic note went in alongside it: a passthrough-resolution error while testing the terminated path usually means the gateway had no certificate and fell through to SNI routing. I spent a while treating that as a DNS problem when the missing certificate was upstream of it.
Housekeeping
Added the
pgrep -fself-match trap, which cost more time than anything else in the run despite being the least interesting thing in it. A waiter looping onpgrep -f "build-image.sh ..."never exits while you check progress with a command whose own command line contains that string — checking kept it waiting, and an image that had been ready for half an hour sat unpushed. The same self-match reported a finished build as still running and, earlier, made a barepgrep -af qemu-systemmatch the grep itself and report a VM that did not exist. The advice is to check for the artifact rather than the process.Also noted that a cluster run leaves a WireGuard interface per node plus a second set of ufw rules and ports, all of which outlive the CVMs.
Verification
prek run --files docs/rc-testing-runbook.mdpasses. Every command and error message quoted here came from the two-node cluster brought up on the TDX host, not from reading the code.