GCE: use chrony on Ubuntu + GCE

Ubuntu on GCE has systemd-timesyncd masked, and recommends (and
preconfigures) chrony instead.
This commit is contained in:
justinsb 2021-09-26 10:21:42 -04:00
parent 93b94be3f3
commit f54cf000fd
2 changed files with 7 additions and 1 deletions

View File

@ -668,3 +668,8 @@ func (c *NodeupModelContext) InstallNvidiaRuntime() bool {
fi.BoolValue(c.NodeupConfig.NvidiaGPU.Enabled) &&
c.GPUVendor == architectures.GPUVendorNvidia
}
// RunningOnGCE returns true if we are running on GCE
func (c *NodeupModelContext) RunningOnGCE() bool {
return kops.CloudProviderID(c.Cluster.Spec.CloudProvider) == kops.CloudProviderGCE
}

View File

@ -59,7 +59,8 @@ func (b *NTPBuilder) Build(c *fi.ModelBuilderContext) error {
}
if b.Distribution.IsDebianFamily() {
if b.Distribution.IsUbuntu() {
// Ubuntu recommends systemd-timesyncd, but on ubuntu on GCE systemd-timesyncd is blocked (in favor of chrony)
if b.Distribution.IsUbuntu() && !b.RunningOnGCE() {
if ntpHost != "" {
c.AddTask(b.buildTimesyncdConf("/etc/systemd/timesyncd.conf", ntpHost))
}