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:

  1. Download kubeconfig of the cluster that you want to configure NTP for:

    • For a management cluster:

      1. Log in to the MOSK management console with the m:kaas:namespace@operator or m:kaas:namespace@writer permissions.

      2. Switch to the required project using the Switch Project action icon located on top of the main left-side navigation panel.

      3. Expand the menu of the tab with your user name.

      4. Click Download kubeconfig to download kubeconfig of your management cluster.

      5. Log in to any local machine with kubectl installed.

      6. Copy the downloaded kubeconfig to this machine.

    • For a MOSK cluster:

      Generate a kubeconfig for a MOSK cluster using API

  2. If you set the ntpEnabled field to false during management cluster bootstrap, skip editing the Cluster object described in the steps below and proceed to step 6. Otherwise, continue with the following step.

  3. Use the downloaded kubeconfig to edit the Cluster object 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.

  4. In the spec.providerSpec.value.kaas section of the Cluster object, set the ntpEnabled field to false.

  5. In the spec.providerSpec.value.kaas.regional section, remove the ntp:servers section 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
                          ...
    
  6. Add the NTP module configuration to the existing HostOSConfiguration object 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.

  7. 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.

  1. Download your management cluster kubeconfig:

    1. Log in to the MOSK management console with the m:kaas:namespace@operator or m:kaas:namespace@writer permissions.

    2. Switch to the required project using the Switch Project action icon located on top of the main left-side navigation panel.

    3. Expand the menu of the tab with your user name.

    4. Click Download kubeconfig to download kubeconfig of your management cluster.

    5. Log in to any local machine with kubectl installed.

    6. Copy the downloaded kubeconfig to this machine.

  2. Use the downloaded kubeconfig to 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.

  3. In the regional section, add the ntp:servers section 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.