diff --git a/nodeup/pkg/model/kubelet.go b/nodeup/pkg/model/kubelet.go index 7db2f6b9e0..8016f2a237 100644 --- a/nodeup/pkg/model/kubelet.go +++ b/nodeup/pkg/model/kubelet.go @@ -690,8 +690,7 @@ func (b *KubeletBuilder) kubeletNames() ([]string, error) { return nil, fmt.Errorf("error describing instances: %v", err) } - useInstanceIDForNodeName := b.Cluster.Spec.ExternalCloudControllerManager != nil && b.IsKubernetesGTE("1.23") - return awsup.GetInstanceCertificateNames(result, useInstanceIDForNodeName) + return awsup.GetInstanceCertificateNames(result, b.NodeupConfig.UseInstanceIDForNodeName) } func (b *KubeletBuilder) buildCgroupService(name string) *nodetasks.Service { diff --git a/nodeup/pkg/model/ntp.go b/nodeup/pkg/model/ntp.go index fbab6fc354..f2beef677b 100644 --- a/nodeup/pkg/model/ntp.go +++ b/nodeup/pkg/model/ntp.go @@ -35,7 +35,7 @@ var _ fi.NodeupModelBuilder = &NTPBuilder{} // Build is responsible for configuring NTP func (b *NTPBuilder) Build(c *fi.NodeupModelBuilderContext) error { - if !b.managed() { + if b.NodeupModelContext.NodeupConfig.NTPUnmanaged { klog.Infof("Managed is set to false; won't install NTP") return nil } @@ -116,11 +116,3 @@ NTP=` + host + ` Mode: s("0644"), } } - -// managed determines if kops should manage the installation and configuration of NTP. -func (b *NTPBuilder) managed() bool { - n := b.Cluster.Spec.NTP - // Consider the NTP is managed when the NTP configuration - // is not specified (for backward compatibility). - return n == nil || n.Managed == nil || *n.Managed -} diff --git a/pkg/apis/nodeup/config.go b/pkg/apis/nodeup/config.go index 610b84b331..a8d6f021c2 100644 --- a/pkg/apis/nodeup/config.go +++ b/pkg/apis/nodeup/config.go @@ -61,6 +61,8 @@ type Config struct { KubeletConfig kops.KubeletConfigSpec // KubeProxy defines the kube-proxy configuration. KubeProxy *kops.KubeProxyConfig + // NTPUnmanaged is true when NTP is not managed by kOps. + NTPUnmanaged bool `json:",omitempty"` // SysctlParameters will configure kernel parameters using sysctl(8). When // specified, each parameter must follow the form variable=value, the way // it would appear in sysctl.conf. @@ -198,6 +200,10 @@ func NewConfig(cluster *kops.Cluster, instanceGroup *kops.InstanceGroup) (*Confi config.KubeProxy = buildKubeProxy(cluster, instanceGroup) + if cluster.Spec.NTP != nil && cluster.Spec.NTP.Managed != nil && !*cluster.Spec.NTP.Managed { + config.NTPUnmanaged = true + } + if cluster.Spec.CloudProvider.AWS != nil { aws := cluster.Spec.CloudProvider.AWS warmPool := aws.WarmPool.ResolveDefaults(instanceGroup)