Skip to content

Conversation

@kvinwang
Copy link
Collaborator

@kvinwang kvinwang commented Dec 2, 2025

This PR introduces WaveKV, a simple distributed KVDB, as the gateway storage backend, replacing direct JSON disk dumps.

Key benefits include:

  • delegating multi-node data synchronization to WaveKV (letting specialized components handle specialized tasks)
  • enabling domain sharing across nodes with unified certificates and ACME accounts.

WaveKV is specifically designed for dstack-gateway.

- Change from /wavekv/status to /prpc/Admin.WaveKvStatus
- Add field name compatibility for both snake_case and camelCase
- Add error message display for debugging
When gateway restarts, persistent store recovers its peer list from WAL,
but ephemeral store is created fresh with empty peers. This causes
ephemeral store to miss peers that were added after initial startup.

Fix by reading peers from persistent store after WAL recovery and
including them when creating the ephemeral store.
When a CVM re-registers on a different gateway node and gets a new IP,
the old IP was not being released when other nodes sync the update.
This caused IP addresses to leak and never be reclaimed.

Fix by checking if IP changed during reload_instances_from_kv_store()
and releasing the old IP before inserting the new one.
When gateway config changes and client_ip_range is modified, existing
CVMs may have IPs outside the new range. The valid_ip() function now
checks if IP is within client_ip_range, causing re-registration to
allocate a new IP within the valid range.
When adding a ZT domain with "Use Default" DNS credential selected,
the frontend sends an empty string for dns_cred_id. The backend now
normalizes empty string to None, allowing the domain to use the
default DNS credential instead of failing with "credential not found".
Change the default port value from 0 to 443 when adding a new ZT domain,
as 443 is the standard HTTPS port and the most common use case.
@kvinwang kvinwang marked this pull request as ready for review January 22, 2026 13:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants