How to modify NTP server IP address in TKGI Control plane and Clusters
search cancel

How to modify NTP server IP address in TKGI Control plane and Clusters

book

Article ID: 345571

calendar_today

Updated On:

Products

VMware Tanzu Kubernetes Grid Integrated Edition VMware Tanzu Kubernetes Grid Integrated Edition 1.x

Issue/Introduction

This article contains the information about how to modify the NTP server in TKGI control plane and on the cluster deployment nodes

Environment

VMware Tanzu Kubernetes Grid Integrated Edition (TKGI)

Resolution

To update a new NTP server IP address on the control plane:

  1. Update the new NTP server IP address at Bosh tile > Director Config > NTP Server section
  2. Navigate to Bosh tile > Director Config, enable the Recreate All VMs option.
  3. Apply changes WITHOUT upgrade all cluster errands in TKGi. This will recreate the bosh, tkgi and harbor vm.

Note: The above steps will update the NTP on bosh, tkgi and harbor vm. However, this will not update on the service-instances as opsman does not have control of it.

 

In order to update NTP IP address on the cluster nodes, follow the below steps. 

1. Export the manifest file for the cluster by running the below command. 

bosh -d <service-instance_ID> manifest ><service-instance_ID>.yml

2. Redeploy the cluster by running the below command. This command will recreate the cluster. 

bosh -d <service-instance_ID> deploy <service-instance_ID>.yml --recreate

Once the changes are applied successfully, you may ssh into the nodes and validate by running the below commands. 

  1. Cat /var/vcap/bosh/etc/ntpserver to see the new NTP server IP
  2. Few additional commands that can be run to validate
  • chronyc activity - show the active ntp servers
  • chronyc tracking - show the status as per above
  • chronyc sources - [-v] : Display information about current sources
  • chronyc sourcestats - [-v] : Display estimation information about current sources

 

Alternative method to VM recreation: In case the recreation of the worker and master nodes of clusters is not desired at the time (after just completed upgrade or in order to minimise the downtime), the clusters can be manually updated with the steps below:

If the VMs are recreated by Bosh Resurrector or the stemcell upgrade is planned, then the NTP configuration will be applied during the recreation, so this alternative method can be beneficial in such cases.

However it should be noted that the NTP will not persist until the VMs have been recreated. If the cluster is redeployed without "recreate" the NTP configuration from Bosh Director will not be applied and the below configuration will be lost.

Create a file with NTP servers add the servers into the file the ntp servers should match the Bosh tile > Director Config :

$ cat ntpserver 
ntp.example.com

Upload the file to the cluster :

bosh -d service-instance_<ID> scp ntpserver :/tmp/.

Copy the new file to the correct  path:

bosh -d service-instance_<ID> ssh  -c "sudo cp /tmp/ntpserver /var/vcap/bosh/etc/"

Execute the sync-time script:

bosh -d service-instance_<ID> ssh  -c "sudo /var/vcap/bosh/bin/sync-time"

Verify new NTP servers are taking place:

bosh -d service-instance_<ID> ssh -c "sudo chronyc sources" | grep stdout

master/<ID>: stdout | MS Name/IP address         Stratum Poll Reach LastRx Last sample
worker/<ID>: stdout | ^* ntp.example.com             2   6   377     4   +276us[ +311us] +/-   28ms
worker/<ID>: stdout | ^* ntp.example.com              2   6   377     3    -18ms[  -21ms] +/-  159ms
master/<ID>: stdout | ^* ntp.example.com              2   6   377     3   +952us[ +996us] +/-   45ms

 

Alternatively trigger burst of sync ntp operations and check the status:

bosh -d service-instance_<ID> ssh -c "sudo chronyc burst 4/4 ; sudo chronyc sources"