Breaking

Wednesday, June 2, 2021

Azure Kubernetes Service - Time sync issue between nodes

We encountered a strange issue this week inside our AKS cluster. We discovered that the time was not synced between the different pods and nodes.

We noticed this because we couldn’t use our  OAuth security tokens as the IssuedAt timing was off.

To validate this issue we ssh’d into the nodes and ran the following command:

$: sudo timedatectl status

This resulted in the following output

Local time: Wed 2021-6-2 13:48:44 UTC
Universal time: Wed 2021-6-2 13:48:44 UTC
RTC time: Wed 2021-6-2 13:48:44
Time zone: Etc/UTC (UTC, +0000)
Network time on: yes

NTP synchronized: no
RTC in local TZ: no

The NTP service was disabled and no NTP service was configured. To fix it we opened the timesyncd.conf:

$: sudo cat /etc/systemd/timesyncd.conf

and changed the NTP value

[Time]
NTP=ntp.ubuntu.com

After that we restarted the timesync service:

$: sudo timedatectl set-ntp true
$: sudo systemctl restart systemd-timesyncd.service

Of course this is only good as a temporary workaround. I would expect that this is enabled by default.

No comments:

Post a Comment