Skip to content

[Idea] Swarm IP heartbeat to SuperAdmin + route53 sync (reachable across EC2 IP changes) #727

Description

Summary

When a swarm's EC2 instance restarts (stop/start, maintenance, or recycling), AWS can assign it a new public IP. The swarm then becomes unreachable at its previous address, and its route53 record (see #516 / #484) points to a stale IP until someone fixes it manually.

Proposal: each swarm reports its current public IP to SuperAdmin once every 5 minutes. SuperAdmin stores the last-known IP per swarm and, if it changed, updates the swarm's route53 record. Swarms stay reachable across IP changes with zero manual intervention.

Proposed steps

  1. Heartbeat sender in the swarm: a small service similar to the existing cln / down / btc / sphinx / tome binaries under src/bin/ that every 5 minutes:
    • resolves the instance's public IP (EC2 instance metadata service, with a fallback for non-EC2 environments)
    • POSTs it to SuperAdmin (/swarm/heartbeat with swarm id + public IP)
  2. Heartbeat endpoint in SuperAdmin (src/bin/super/routes.rs): accepts the heartbeat, stores last_ip + last_heartbeat_at per swarm, and compares the IP against the previously stored one.
  3. route53 update (src/bin/super/route53.rs): when the reported IP differs from the stored IP, upsert the A record for the swarm's domain, reusing the route53 helpers already in place for swarm setup.

Storage

Keep last_ip and last_heartbeat_at on the swarm record, persisted the same way other swarm state is stored in SuperAdmin.

Notes

Pros / Cons

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions