Update Harvester Configuration After Installation
Harvester's OS has an immutable design, which means most files in the OS revert to their pre-configured state after a reboot. The Harvester OS loads the pre-configured values of system components from configuration files during the boot time.
To update a configuration, you must first update the runtime value in the system and then update configuration files to ensure that changes persist between reboots.
However, starting with v1.7.0, network configuration changes made using the nmcli tool persist automatically because the /etc/NetworkManager directory is now included in the list of persistent paths.
If you upgrade from a version before v1.1.2, the cloud-init file in examples will be /oem/99_custom.yaml. Please substitute the value if needed.
Password of user rancher
Runtime change
Log in to a Harvester node using the
rancheruser account.Reset the password for the
rancheruser account by running the commandpasswd.
Configuration persistence
Backup the elemental
cloud-initfile/oem/90_custom.yamlas follows:cp /oem/90_custom.yaml /oem/install/90_custom.yaml.$(date --iso-8601=minutes)Edit
/oem/90_custom.yamland update the yaml pathstages.initramfs[0].users.rancher.passwd.For information about specifying the
rancheruser account password in an encrypted form, seeos.password.
NTP servers
We introduced a new mechanism for NTP configuration in Harvester v1.2.0.
For more information about NTP settings in Harvester v1.2.0 and later versions, see NTP servers.
DNS servers
Log in to a Harvester node using the root account.
Check the management interface configuration, and then run either of the following commands:
Not configured to use a VLAN:
nmcli con modify bridge-mgmt ipv4.dns 8.8.8.8,1.1.1.1 && nmcli device reapply mgmt-brConfigured to use a VLAN:
You must replace
VLAN_IDwith the actual ID. To view a list of configured connections and devices, run the commandnmcli con.
nmcli con modify vlan-mgmt ipv4.dns 8.8.8.8,1.1.1.1 && nmcli device reapply mgmt-br.VLAN_IDVerify that the file
/etc/resolv.confcontains the correct DNS servers by running thecatcommand.
```
cat /etc/resolv.conf
```
Restart the
rke2-corednsdeployment.kubectl rollout restart deployment/rke2-coredns-rke2-coredns -n kube-systemVerify that the
rke2-corednsdeployment was rolled out successfully.kubectl rollout status deployment/rke2-coredns-rke2-coredns -n kube-system
Bonding slaves
You can update the slave interfaces of Harvester's management bonding interface mgmt-bo.
Log in to a Harvester node and become root. See how to log into a Harvester node for more details.
Identify the interface names with the following command:
$ nmcli device
DEVICE TYPE STATE CONNECTION
mgmt-br bridge connected bridge-mgmt
...
mgmt-bo bond connected bond-mgmt
ens6 ethernet connected bond-slave-ens6
ens7 ethernet disconnected --
...Use the
nmclitool to create a connection for the interface and attach it to the management bond.Example:
$ nmcli con add type bond-slave ifname ens7 master mgmt-bo
Connection 'bond-slave-ens7' (5a379328-178a-4167-b065-b5426facd659) successfully added.You should now be able to see the device is connected:
$ nmcli device
DEVICE TYPE STATE CONNECTION
mgmt-br bridge connected bridge-mgmt
...
mgmt-bo bond connected bond-mgmt
ens6 ethernet connected bond-slave-ens6
ens7 ethernet connected bond-slave-ens7