Peer networking among VM instances

You can open ports up. There is a FLY_PUBLIC_IP environment variable with the VMs public ipv6 address. You can open public ports up with an experimental config setting:

  [experimental]
  allowed_public_ports = [8080]

Determining cluster leader is harder. I can imagine two ways of doing this:

  1. Most Raft apps I’ve seen can be configured with a leader seed. You could run an app with min/max counts of 1 that’s the leader at boot time. Then run a second app that uses the first app’s public load balanced IP to “see” the leader.
  2. You can probably do something with DNS. We’ve experimented with apps that write their IP to a DNSimple record, if you have a way to make outside API calls when a leader is promoted you could maintain a leader.example.com AAAA record with the current leader’s public IP address.

This kind of use case is something we want to make work well, and we have some ideas on how to do it easier, so I’m curious what you can figure out.

2 Likes