4.2 NTP Setup
Info
If you set additionalNTPSources in your agent-config.yaml, skip this step, you do not need to do this as NTP would've been configured during install.
Configuring a time source for the disconnected cluster¶
We need to apply a custom Network Time Protocol (NTP) configuration to the nodes, because by default, internet connectivity is assumed in OpenShift Container Platform and chronyd is configured to use the *.rhel.pool.ntp.org servers.
-
Create a Butane config including the contents of the
chrony.conffile. For example, to configure chrony on master nodes, create a99-master-chrony.bufile. Do the same for worker nodes by swapping the metadatanameand themachineconfiguration.openshift.io/rolelabel.The Butane version you specify in the config file should match the OpenShift Container Platform version and always ends in
0. For example,4.17.0.
variant: openshift
version: 4.17.0
metadata:
name: 99-master-chrony # (1)! On control plane nodes, substitute master for worker in both of these locations
labels:
machineconfiguration.openshift.io/role: master # (2)! On control plane nodes, substitute master for worker in both of these locations
storage:
files:
- path: /etc/chrony.conf
mode: 0644 # (3)! Specify an octal value mode for the mode field in the machine config file
overwrite: true
contents:
inline: | # (4)! Specify any valid, reachable time source. `172.16.10.123` is an example time server. IP address or hostname is accepatable
pool 172.16.10.123 iburst
driftfile /var/lib/chrony/drift
makestep 1.0 3
rtcsync
logdir /var/log/chrony
-
2. Use Butane to generate a
MachineConfig object file, 99-master-chrony.yaml, containing the configuration to be delivered to the nodes
-
3. Apply the configurations in one of two ways:
-
If the cluster is not running yet, after you generate manifest files, add the
MachineConfigobject file to theinstallation_directory/openshiftdirectory, and then continue to create the cluster. - If the cluster is already running, apply the file
- On worker nodes, change
mastertoworker - On worker nodes, change
mastertoworker - Specify an octal value mode for the
modefield in the machine config file. After creating the file and applying the changes, themodeis converted to a decimal value. You can check the YAML file with the commandoc get mc <mc-name> -o yaml - Specify any valid, reachable time source.
172.16.10.123is an example time server. IP address or hostname is accepatable