feat(dns-server): run embedded internal DNS server on machine IP in uncloudd daemon process

This commit is contained in:
Pavel Sviderski
2025-04-30 17:24:52 +10:00
parent d6c06828b3
commit 8d16da596c
4 changed files with 105 additions and 70 deletions
+5 -4
View File
@@ -2,10 +2,11 @@ package network
import (
"fmt"
"github.com/psviderski/uncloud/internal/secret"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
"net"
"net/netip"
"github.com/psviderski/uncloud/internal/secret"
"golang.zx2c4.com/wireguard/wgctrl/wgtypes"
)
type Config struct {
@@ -13,7 +14,7 @@ type Config struct {
// in the subnet. Other IP addresses are allocated to containers running on the machine.
Subnet netip.Prefix
// ManagementIP is the IPv6 address assigned to the machine within the WireGuard network. This address is used
// for cluster management traffic, such as gRPC communication with the machine API server and Serf gossip.
// for cluster management traffic, such as gRPC communication with the machine API server and Corrosion gossip.
ManagementIP netip.Addr
PrivateKey secret.Secret
PublicKey secret.Secret
@@ -23,7 +24,7 @@ type Config struct {
type PeerConfig struct {
Subnet *netip.Prefix `json:",omitempty"`
// ManagementIP is the IPv6 address assigned to the peer within the WireGuard network. This address is used
// for cluster management traffic, such as gRPC communication with the machine API server and Serf gossip.
// for cluster management traffic, such as gRPC communication with the machine API server and Corrosion gossip.
ManagementIP netip.Addr
Endpoint *netip.AddrPort `json:",omitempty"`
AllEndpoints []netip.AddrPort `json:",omitempty"`
+2 -1
View File
@@ -2,9 +2,10 @@ package network
import (
"fmt"
"github.com/psviderski/uncloud/internal/secret"
"net"
"net/netip"
"github.com/psviderski/uncloud/internal/secret"
)
// MachineIP returns the IP address of the machine which is the first address in the subnet.