Skip to content
This repository has been archived by the owner on Oct 24, 2023. It is now read-only.

feat: Enable chrony and host-based time sync by default on Ubuntu 18.04 #4011

Merged
merged 9 commits into from
Nov 19, 2020

Conversation

ericsuhong
Copy link
Contributor

Reason for Change:
Use chrony + host-based time sync which is a recommended way and also work in airgap clouds.

All Azure Ubuntu 18.04 stock images already come with chrony enabled as well.

Issue Fixed:
#2552

Credit Where Due:

Does this change contain code from or inspired by another project?

  • No
  • Yes

If "Yes," did you notify that project's maintainers and provide attribution?

  • No
  • Yes

Requirements:

Notes:
Reference: https://docs.microsoft.com/en-us/azure/virtual-machines/linux/time-sync

@acs-bot acs-bot added the size/M label Nov 6, 2020
@ericsuhong ericsuhong changed the title feat: Enable chrony and host-based time sync by default in Ubuntu 18.04 feat: Enable chrony and host-based time sync by default on Ubuntu 18.04 Nov 6, 2020
@jackfrancis
Copy link
Member

/azp run pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@jackfrancis
Copy link
Member

/azp run pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@codecov
Copy link

codecov bot commented Nov 7, 2020

Codecov Report

Merging #4011 (e70b683) into master (5dbff4c) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4011   +/-   ##
=======================================
  Coverage   73.08%   73.08%           
=======================================
  Files         145      145           
  Lines       21776    21776           
=======================================
  Hits        15914    15914           
  Misses       4829     4829           
  Partials     1033     1033           
Impacted Files Coverage Δ
pkg/engine/templates_generated.go 43.70% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5dbff4c...e70b683. Read the comment docs.

@ericsuhong
Copy link
Contributor Author

/azp run pr-e2e

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 4011 in repo Azure/aks-engine

@@ -87,9 +87,8 @@ fi
{{end}}

if [[ ${UBUNTU_RELEASE} == "18.04" ]]; then
if apt list --installed | grep 'ntp'; then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In order for this to work on 18.04 prior to building a new VHD w/ chrony already installed is to protect the configureChrony and ensureChrony invokations inside a if apt list --installed | grep 'chrony'; then block.

Otherwise we're going to get a CSE error on all 18.04 VHD nodes ("distro": "aks-ubuntu-18.04"):

+ sleep 5
+ for i in $(seq 1 $retries)
+ timeout 30 systemctl daemon-reload
+ timeout 30 systemctl restart chrony
Failed to restart chrony.service: Unit chrony.service not found.
+ '[' 100 -eq 100 ']'
+ return 1
+ ret=1
+ systemctl status chrony --no-pager -l
Unit chrony.service could not be found.
+ '[' 1 -ne 0 ']'
+ return 1
+ exit 4

@jackfrancis
Copy link
Member

tested this changeset locally using the non-VHD 18.04 image and am consistently getting a failure in this E2E scenario:

https://github.com/Azure/aks-engine/blob/master/test/e2e/kubernetes/kubernetes_test.go#L2724

(not sure why, will have to look into it)

@jackfrancis
Copy link
Member

cc @Michael-Sinz @jadarsie

This passes my smoke tests, am planning to merge.

@jackfrancis
Copy link
Member

/azp run pr-e2e

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Member

@jackfrancis jackfrancis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@acs-bot
Copy link

acs-bot commented Nov 18, 2020

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ericsuhong, jackfrancis

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@jackfrancis jackfrancis merged commit 5689c85 into Azure:master Nov 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants