Skip to content

Commit

Permalink
Merge pull request #12587 from justinsb/chrony_on_ubuntu_gce
Browse files Browse the repository at this point in the history
GCE: use chrony on Ubuntu + GCE
  • Loading branch information
k8s-ci-robot committed Oct 23, 2021
2 parents 6cf33f7 + f54cf00 commit 03044b7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
5 changes: 5 additions & 0 deletions nodeup/pkg/model/context.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
3 changes: 2 additions & 1 deletion nodeup/pkg/model/ntp.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down

0 comments on commit 03044b7

Please sign in to comment.