diff --git a/services/manager.go b/services/manager.go index 9dad1cae7eb77d609765670c837ef24d9a97cacf..ecaee156c0c1a9c1615f2ba20cefc1b07dd72629 100644 --- a/services/manager.go +++ b/services/manager.go @@ -72,12 +72,10 @@ type Cluster struct { type Unit = daeman.Unit[*Cluster] func NewManager(settings *ClusterSettings, node *HeptoMeta, logger logr.Logger) *daeman.Manager[*Cluster] { - networking := NewClusterNetworking(settings.Name, node.Name) - node.VpnIP = networking.NodeAddress cluster := &Cluster{ settings: settings, thisNode: node, - networking: networking, + networking: NewClusterNetworking(settings.Name, node.Name), loopbackToken: uuid.NewString(), nodes: []*HeptoMeta{}, state: &HeptoState{ diff --git a/services/meta.go b/services/meta.go index 79836fd141a45bb53ce013c075cd2abf4bee6f41..d05efaa96cbadcaf6a70388f863f5da6154b2777 100644 --- a/services/meta.go +++ b/services/meta.go @@ -13,9 +13,9 @@ type HeptoMeta struct { Name string `json:"name"` // Public address of the node PublicIP netip.Addr `json:"ip"` - // Address of the node over the VPN + // Address of the node over the VPN, set once the VPN is up VpnIP netip.Prefix `json:"vpnIP"` - // Public key for the wireguard mesh VPN + // Public key for the wireguard mesh VPN, set once the VPN is up VpnKey string `json:"vpnKey"` // Node role inside the cluster Role string `json:"role"` @@ -35,6 +35,7 @@ func (m *HeptoMeta) OverlayIP() netip.Prefix { } func (m *HeptoMeta) Routes() []netip.Prefix { + // We do not currently support exposing additional routes return []netip.Prefix{} } diff --git a/services/vpn.go b/services/vpn.go index 741049347634a35373678931b0eff947ccb4abc4..994640155e86d7a6f6752345689b62d1d698c082 100644 --- a/services/vpn.go +++ b/services/vpn.go @@ -28,6 +28,7 @@ var vpn = &Unit{ return err } c.settings.Logger.Info("initialized vpn", "key", vpn.PubKey.String()) + c.thisNode.VpnIP = c.networking.NodeAddress c.thisNode.VpnKey = vpn.PubKey.String() c.vpn = vpn return nil