diff --git a/nodeup/pkg/model/protokube.go b/nodeup/pkg/model/protokube.go index 0464b6bc1f..4b8a66d37d 100644 --- a/nodeup/pkg/model/protokube.go +++ b/nodeup/pkg/model/protokube.go @@ -184,7 +184,7 @@ func (t *ProtokubeBuilder) ProtokubeFlags() (*ProtokubeFlags, error) { f.ClusterID = fi.PtrTo(t.NodeupConfig.ClusterName) - zone := t.Cluster.Spec.DNSZone + zone := t.NodeupConfig.DNSZone if zone != "" { if strings.Contains(zone, ".") { // match by name @@ -202,15 +202,15 @@ func (t *ProtokubeBuilder) ProtokubeFlags() (*ProtokubeFlags, error) { if t.UsesLegacyGossip() { klog.Warningf("using (legacy) gossip DNS", t.NodeupConfig.ClusterName) f.Gossip = fi.PtrTo(true) - if t.Cluster.Spec.GossipConfig != nil { - f.GossipProtocol = t.Cluster.Spec.GossipConfig.Protocol - f.GossipListen = t.Cluster.Spec.GossipConfig.Listen - f.GossipSecret = t.Cluster.Spec.GossipConfig.Secret + if t.NodeupConfig.GossipConfig != nil { + f.GossipProtocol = t.NodeupConfig.GossipConfig.Protocol + f.GossipListen = t.NodeupConfig.GossipConfig.Listen + f.GossipSecret = t.NodeupConfig.GossipConfig.Secret - if t.Cluster.Spec.GossipConfig.Secondary != nil { - f.GossipProtocolSecondary = t.Cluster.Spec.GossipConfig.Secondary.Protocol - f.GossipListenSecondary = t.Cluster.Spec.GossipConfig.Secondary.Listen - f.GossipSecretSecondary = t.Cluster.Spec.GossipConfig.Secondary.Secret + if t.NodeupConfig.GossipConfig.Secondary != nil { + f.GossipProtocolSecondary = t.NodeupConfig.GossipConfig.Secondary.Protocol + f.GossipListenSecondary = t.NodeupConfig.GossipConfig.Secondary.Listen + f.GossipSecretSecondary = t.NodeupConfig.GossipConfig.Secondary.Secret } } diff --git a/pkg/apis/nodeup/config.go b/pkg/apis/nodeup/config.go index be01d1a063..46f4a15c25 100644 --- a/pkg/apis/nodeup/config.go +++ b/pkg/apis/nodeup/config.go @@ -94,6 +94,10 @@ type Config struct { // APIServerConfig is additional configuration for nodes running an APIServer. APIServerConfig *APIServerConfig `json:",omitempty"` + // GossipConfig is configuration for gossip DNS. + GossipConfig *kops.GossipConfig `json:",omitempty"` + // DNSZone is the DNS zone we should use when configuring DNS. + DNSZone string `json:",omitempty"` // NvidiaGPU contains the configuration for nvidia NvidiaGPU *kops.NvidiaGPUConfig `json:",omitempty"` @@ -329,6 +333,14 @@ func NewConfig(cluster *kops.Cluster, instanceGroup *kops.InstanceGroup) (*Confi config.Networking.EgressProxy = cluster.Spec.Networking.EgressProxy } + if instanceGroup.IsControlPlane() || cluster.UsesLegacyGossip() { + config.DNSZone = cluster.Spec.DNSZone + } + + if cluster.UsesLegacyGossip() { + config.GossipConfig = cluster.Spec.GossipConfig + } + if len(instanceGroup.Spec.SysctlParameters) > 0 { config.SysctlParameters = append(config.SysctlParameters, "# Custom sysctl parameters from instance group spec",