Configure NTP server¶
If you did not add the NTP server parameters during cluster deployment, configure them on the existing management or MOSK cluster as required. These parameters are applied to all cluster machines.
Warning
The procedures below trigger an upgrade of all cluster machines, which may lead to workload disruptions during node cordoning and draining.
Configure NTP using the NTP module¶
TechPreview
You can use the NTP host operating system (OS) configuration module as a flexible way to manage different NTP settings for machines of management and MOSK clusters. For concepts of the host OS configuration API, see Host operating system configuration.
To configure NTP using the NTP module:
Download
kubeconfigof the cluster that you want to configure NTP for:For a management cluster:
Log in to the MOSK management console with the
m:kaas:namespace@operatororm:kaas:namespace@writerpermissions.Switch to the required project using the Switch Project action icon located on top of the main left-side navigation panel.
Expand the menu of the tab with your user name.
Click Download kubeconfig to download
kubeconfigof your management cluster.Log in to any local machine with
kubectlinstalled.Copy the downloaded
kubeconfigto this machine.
For a MOSK cluster:
If you set the
ntpEnabledfield tofalseduring management cluster bootstrap, skip editing theClusterobject described in the steps below and proceed to step 6. Otherwise, continue with the following step.Use the downloaded
kubeconfigto edit theClusterobject of the required cluster:kubectl --kubeconfig <kubeconfigPath> edit -n <projectName> cluster <ClusterName>
In the command above and the steps below, replace the parameters enclosed in angle brackets with the corresponding values of your cluster.
In the
spec.providerSpec.value.kaassection of theClusterobject, set thentpEnabledfield tofalse.In the
spec.providerSpec.value.kaas.regionalsection, remove thentp:serverssection with the list of server names:spec: ... providerSpec: value: kaas: ... ntpEnabled: false ... regional: - helmReleases: - name: baremetal-provider values: config: lcm: ... ntp: servers: - 0.pool.ntp.org ...
Add the NTP module configuration to the existing
HostOSConfigurationobject or create a new one. Also, set the dedicated machine selectors and labels to apply NTP configuration to the target machines. For description of parameters, see HostOSConfiguration and NTP module documentation.Apply the changes:
kubectl --kubeconfig <kubeconfigPath> patch -n <projectName> -f <hostOSConfiguration.yaml>
Configure NTP using the Cluster object¶
Caution
The procedure below applies only if ntpEnabled=true (default)
was set during a management cluster bootstrap. Otherwise, proceed to
Configure NTP using the NTP module.
Download your management cluster
kubeconfig:Log in to the MOSK management console with the
m:kaas:namespace@operatororm:kaas:namespace@writerpermissions.Switch to the required project using the Switch Project action icon located on top of the main left-side navigation panel.
Expand the menu of the tab with your user name.
Click Download kubeconfig to download
kubeconfigof your management cluster.Log in to any local machine with
kubectlinstalled.Copy the downloaded
kubeconfigto this machine.
Use the downloaded
kubeconfigto edit the management cluster:kubectl --kubeconfig <kubeconfigPath> edit -n <projectName> cluster <managementClusterName>
In the command above and the step below, replace the parameters enclosed in angle brackets with the corresponding values of your cluster.
In the
regionalsection, add thentp:serverssection with the list of required server names:spec: ... providerSpec: value: kaas: ... ntpEnabled: true ... regional: - helmReleases: - name: baremetal-provider values: config: lcm: ... ntp: servers: - 0.pool.ntp.org ...
These parameters are applied to all machines of MOSK clusters deployed within the configured management cluster.