mirror of https://github.com/kubernetes/kops.git
Use NodeupConfig for NTP-managed setting
This commit is contained in:
parent
fea27074aa
commit
447220ef4e
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue