To synchronize time on Deckhouse cluster nodes, DKP uses a built-in solution based on chrony. Using the Network Time Protocol (NTP), DKP ensures that system clocks on cluster nodes are synchronized with external NTP servers. If required, you can disable this built-in mechanism and configure custom NTP daemons.

Enabling built-in time synchronization

Enable the chrony module to activate time synchronization:

d8 platform module enable chrony

By default, the time source is the server pool.ntp.org. You can specify a list of NTP servers using the ntpServers parameter in the configuration of the chrony module.

An example of the module configuration specifying NTP servers:

apiVersion: deckhouse.io/v1alpha1
kind: ModuleConfig
metadata:
  name: chrony
spec:
  enabled: true
  settings:
    ntpServers:
      - ntp.ubuntu.com
      - time.google.com
  version: 1

Using custom NTP daemons

To disable the built-in time synchronization mechanism and use your own NTP daemons on the nodes, follow these steps:

  1. Disable the chrony module:

    d8 platform module disable chrony
    

    If the command is successful, you should see the message confirming that the module has been disabled:

    Module chrony disabled
    
  2. Create a NodeGroupConfiguration resource to enable the NTP daemons on the nodes.

    Example for systemd-timesyncd:

    d8 k apply -f - <<EOF
    apiVersion: deckhouse.io/v1alpha1
    kind: NodeGroupConfiguration
    metadata:
      name: enable-ntp-on-node.sh
    spec:
      weight: 100
      nodeGroups: ["*"]
      bundles: ["*"]
      content: |
        systemctl enable systemd-timesyncd
        systemctl start systemd-timesyncd
    EOF