4.2 NTP Setup
Configuring a time source for the disconnected cluster¶
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.
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.conf
file. For example, to configure chrony on master nodes, create a99-master-chrony.bu
file. Do the same for worker nodes by swapping the metadataname
and themachineconfiguration.openshift.io/role
label.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
MachineConfig
object file to theinstallation_directory/openshift
directory, and then continue to create the cluster. - If the cluster is already running, apply the file
- On worker nodes, change
master
toworker
- On worker nodes, change
master
toworker
- Specify an octal value mode for the
mode
field in the machine config file. After creating the file and applying the changes, themode
is 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.123
is an example time server. IP address or hostname is accepatable