Merge pull request #12587 from justinsb/chrony_on_ubuntu_gce

GCE: use chrony on Ubuntu + GCE
This commit is contained in:
Kubernetes Prow Robot 2021-10-23 14:02:21 -07:00 committed by GitHub
commit 03044b79a6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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))
}