capv@workload-test-md-0-7f58fcbbf4-splb4 [ ~ ]$ timedatectl
Local time: Mon 2023-02-20 05:02:26 UTC
Universal time: Mon 2023-02-20 05:02:26 UTC
RTC time: Mon 2023-02-20 05:02:26
Time zone: UTC (UTC, +0000)
System clock synchronized: yes
NTP service: inactive
RTC in local TZ: no
Photon OS 3.0 by default supports systemd-timesyncd service for network time synchronization and when chronyd service is used for timesync "timedatectl" commands doesn't work.
Product team identified this and provided the fix to enable Chronyd service as well for NTP along with systemd-timesyncd
kubectl config set-context <management cluster context name>
2. Start patching the control plane nodes
kubectl patch -n <namespace-where-cluster-resides> KubeadmControlPlane <kubeadm-control-plane-object> --type='json' -p='[
{"op": "add", "path": "/spec/kubeadmConfigSpec/preKubeadmCommands/-", "value": "echo \"Environment=SYSTEMD_TIMEDATED_NTP_SERVICES=chronyd.service:systemd-timesyncd.service \" >> /lib/systemd/system/systemd-timedated.service"},
{"op": "add", "path": "/spec/kubeadmConfigSpec/preKubeadmCommands/-", "value": "systemctl daemon-reload"},
{"op": "add", "path": "/spec/kubeadmConfigSpec/preKubeadmCommands/-", "value": "systemctl restart chronyd"}]'
This will roll out the Control plane nodes automatically and wait for the control plane nodes to be recreated
kubectl patch -n <namespace-where-cluster-resides> KubeadmConfigTemplate <kubeadm-config-template-object> --type='json' -p='[
{"op": "add", "path": "/spec/template/spec/preKubeadmCommands/-", "value": "echo \"Environment=SYSTEMD_TIMEDATED_NTP_SERVICES=chronyd.service:systemd-timesyncd.service \" >> /lib/systemd/system/systemd-timedated.service"},
{"op": "add", "path": "/spec/template/spec/preKubeadmCommands/-", "value": "systemctl daemon-reload"},
{"op": "add", "path": "/spec/template/spec/preKubeadmCommands/-", "value": "systemctl restart chronyd"}]'
kubectl patch machinedeployment MACHINE-DEPLOYMENT --type merge -p "{\"spec\":{\"template\":{\"metadata\":{\"annotations\":{\"date\":\"`date +'%s'`\"}}}}}"