diff --git a/services/kubelet.go b/services/kubelet.go index c8e8c8381a30e240570c84b604d3ab833f07c079..7246183a3a2c2662af5a224bb4c2790f81e08201 100644 --- a/services/kubelet.go +++ b/services/kubelet.go @@ -64,6 +64,8 @@ var kubeKubelet = &Unit{ // Customize the config cfg.ContainerRuntimeEndpoint = "unix://" + ContainerdSocket + cfg.ClusterDNS = []string{c.networking.DNSAddress.String()} + cfg.ClusterDomain = fmt.Sprintf("%s.local", c.settings.Name) // Prepare Kubelet dependencies, these are stored in a Dpeendencies instance, which is both used // for direct access and as an argument for kubelet initialization diff --git a/services/manager.go b/services/manager.go index 9465b06fd6cfd436702839feba78ca33c89ca7b1..dbcefe7b5e7dd94dbade97fd97ac0aeb8d992406 100644 --- a/services/manager.go +++ b/services/manager.go @@ -43,6 +43,7 @@ type ClusterNetworking struct { ServiceNet *net.IPNet PodNet *net.IPNet APIAddress net.IP + DNSAddress net.IP MTU int } @@ -118,5 +119,6 @@ func NewClusterNetworking(clusterName string, nodeName string) *ClusterNetworkin // API address is the first service address apiAddress, _ := netip.AddrFromSlice(serviceNet.IP) apiIP := net.IP(apiAddress.Next().AsSlice()) - return &ClusterNetworking{nodeNet, nodeAddress, serviceNet, podNet, apiIP, 1500} + dnsIP := net.IP(apiAddress.Next().Next().AsSlice()) + return &ClusterNetworking{nodeNet, nodeAddress, serviceNet, podNet, apiIP, dnsIP, 1500} }