mirror of https://github.com/kubernetes/kops.git
GCE: use chrony on Ubuntu + GCE
Ubuntu on GCE has systemd-timesyncd masked, and recommends (and preconfigures) chrony instead.
This commit is contained in:
parent
93b94be3f3
commit
f54cf000fd
|
@ -668,3 +668,8 @@ func (c *NodeupModelContext) InstallNvidiaRuntime() bool {
|
||||||
fi.BoolValue(c.NodeupConfig.NvidiaGPU.Enabled) &&
|
fi.BoolValue(c.NodeupConfig.NvidiaGPU.Enabled) &&
|
||||||
c.GPUVendor == architectures.GPUVendorNvidia
|
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
|
||||||
|
}
|
||||||
|
|
|
@ -59,7 +59,8 @@ func (b *NTPBuilder) Build(c *fi.ModelBuilderContext) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
if b.Distribution.IsDebianFamily() {
|
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 != "" {
|
if ntpHost != "" {
|
||||||
c.AddTask(b.buildTimesyncdConf("/etc/systemd/timesyncd.conf", ntpHost))
|
c.AddTask(b.buildTimesyncdConf("/etc/systemd/timesyncd.conf", ntpHost))
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue