Skip to content

Commit 438cfbe

Browse files
committed
feat: update docs for NetworkManager
Related-to: harvester/harvester#3418 Signed-off-by: Tim Serong <[email protected]>
1 parent 39cb6c7 commit 438cfbe

File tree

8 files changed

+206
-113
lines changed

8 files changed

+206
-113
lines changed

docs/install/harvester-configuration.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -280,10 +280,10 @@ DNS resolution is unavailable in the `after-install-chroot stage`, and the `name
280280
```yaml
281281
os:
282282
after_install_chroot_commands:
283-
- "rm -f /etc/resolv.conf && echo 'nameserver 8.8.8.8' | sudo tee /etc/resolv.conf"
283+
- "echo 'nameserver 8.8.8.8' | sudo tee /etc/resolv.conf"
284284
- "mkdir /usr/local/bin"
285285
- "curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 && chmod 700 get_helm.sh && ./get_helm.sh"
286-
- "rm -f /etc/resolv.conf && ln -s /var/run/netconfig/resolv.conf /etc/resolv.conf"
286+
- "rm -f /etc/resolv.conf"
287287
```
288288

289289

docs/install/requirements.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ Harvester nodes require the following port connections or inbound rules. Typical
9090
| TCP | 9796 | Harvester management and compute nodes | Node-exporter |
9191
| TCP | 30000-32767 | Harvester management and compute nodes | NodePort port range |
9292
| TCP | 22 | Harvester management and compute nodes | sshd |
93-
| UDP | 68 | Harvester management and compute nodes | Wicked |
93+
| UDP | 68 | Harvester management and compute nodes | NetworkManager |
9494
| TCP | 3260 | Harvester management and compute nodes | iscsid |
9595

9696
### Port Requirements for Integrating Harvester with Rancher

docs/install/update-harvester-configuration.md

Lines changed: 78 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -20,23 +20,25 @@ This page describes how to edit some of the most-requested Harvester configurati
2020

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

23+
If you upgrade from a version before `v1.7.0`, any changes to network and DNS configuration need to be made in the `/oem/91_networkmanager.yaml` file instead of in `/oem/90_custom.yaml`. Please substitute the value if needed.
24+
2325
:::
2426

2527
## DNS servers
2628

2729
### Runtime change
2830

2931
1. Log in to a Harvester node and become root. See [how to log into a Harvester node](../troubleshooting/os.md#how-to-log-in-to-a-harvester-node) for more details.
30-
1. Edit `/etc/sysconfig/network/config` and update the following line. Use a space to separate DNS server addresses if there are multiple servers.
32+
1. If the management interface _is not_ configured to use a VLAN, run the following command:
3133

3234
```
33-
NETCONFIG_DNS_STATIC_SERVERS="8.8.8.8 1.1.1.1"
35+
nmcli con modify bridge-mgmt ipv4.dns 8.8.8.8,1.1.1.1 && nmcli device reapply mgmt-br
3436
```
3537
36-
1. Update and reload the configuration with the following command:
38+
1. If the management interface _is_ configured to use a VLAN, run the following commands. Replace `VLAN_ID` with the actal ID of the VLAN. If in doubt, run `nmcli con` to see the configured connections and devices.
3739
3840
```
39-
netconfig update
41+
nmcli con modify vlan-mgmt ipv4.dns 8.8.8.8,1.1.1.1 && nmcli device reapply mgmt-br.VLAN_ID
4042
```
4143
4244
1. Confirm the file `/etc/resolv.conf` contains the correct DNS servers with the `cat` command:
@@ -55,28 +57,39 @@ If you upgrade from a version before `v1.1.2`, the `cloud-init` file in examples
5557
5658
### Configuration persistence
5759
58-
Beginning with v1.1.2, the persistent name of the cloud-init file is `/oem/90_custom.yaml`. Harvester now uses a newer version of Elemental, which creates the file during installation.
60+
:::note
5961
60-
When upgrading from an earlier version to `v1.1.2` or later, Harvester retains the old file name (`/oem/99_custom.yaml`) to avoid confusion. You can manually rename the file to `/oem/90_custom.yaml` if necessary.
62+
If you upgrade from a version before `v1.7.0`, the changes below need to be made in the `/oem/91_networkmanager.yaml` file instead of in `/oem/90_custom.yaml`.
63+
64+
:::
6165
6266
1. Backup the elemental `cloud-init` file `/oem/90_custom.yaml` as follows:
6367
6468
```
6569
cp /oem/90_custom.yaml /oem/install/90_custom.yaml.$(date --iso-8601=minutes)
6670
```
6771
68-
1. Edit `/oem/90_custom.yaml` and update the value under the yaml path `stages.initramfs[0].commands`. The `commands` array must contain a line to manipulate the `NETCONFIG_DNS_STATIC_SERVERS` config. Add the line if the line doesn't exist.
72+
1. Edit `/oem/90_custom.yaml` and update the value under the yaml path `stages.network[0].commands`. The `commands` array must contain a line to manipulate the NetworkManager DNS configuration for the management interface. This is the exact same command used above when making the change at runtime. Add the line if the line doesn't exist.
6973
70-
The following example adds a line to change the `NETCONFIG_DNS_STATIC_SERVERS` config:
74+
The following example adds a line to configure DNS servers when not using a VLAN on the management interface:
7175
7276
```
7377
stages:
74-
initramfs:
78+
network:
79+
- commands:
80+
- nmcli con modify bridge-mgmt ipv4.dns 8.8.8.8,1.1.1.1 && nmcli device reapply mgmt-br
81+
```
82+
83+
The following example adds a line to configure DNS servers when using VLAN 2017 on the management interface:
84+
85+
```
86+
stages:
87+
network:
7588
- commands:
76-
- sed -i 's/^NETCONFIG_DNS_STATIC_SERVERS.*/NETCONFIG_DNS_STATIC_SERVERS="8.8.8.8 1.1.1.1"/' /etc/sysconfig/network/config
89+
- nmcli con modify vlan-mgmt ipv4.dns 8.8.8.8,1.1.1.1 && nmcli device reapply mgmt-br.2017
7790
```
7891
79-
Replace the DNS server addresses and save the file. Harvester sets up new servers after rebooting.
92+
Replace the DNS server addresses and VLAN ID if applicable and save the file. Harvester sets up new servers after rebooting.
8093
8194
8295
## NTP servers
@@ -113,78 +126,80 @@ You can update the slave interfaces of Harvester's management bonding interface
113126
1. Identify the interface names with the following command:
114127
115128
```
116-
ip a
129+
$ nmcli device
130+
DEVICE TYPE STATE CONNECTION
131+
mgmt-br bridge connected bridge-mgmt
132+
...
133+
mgmt-bo bond connected bond-mgmt
134+
ens6 ethernet connected bond-slave-ens6
135+
ens7 ethernet disconnected --
136+
...
117137
```
118138
119-
1. Edit `/etc/sysconfig/network/ifcfg-mgmt-bo` and update the lines associated with bonding slaves and bonding mode:
139+
1. Use `nmcli` to create a connection for the interface and attach it to the management bond, for example:
120140
121141
```
122-
BONDING_SLAVE_0='ens5'
123-
BONDING_SLAVE_1='ens6'
124-
BONDING_MODULE_OPTS='miimon=100 mode=balance-tlb '
125-
```
142+
$ nmcli con add type bond-slave ifname ens7 master mgmt-bo
143+
Connection 'bond-slave-ens7' (5a379328-178a-4167-b065-b5426facd659) successfully added.
126144
127-
1. Restart the network with the `wicked ifreload` command:
145+
1. You should now be able to see the device is connected:
128146
129147
```
130-
wicked ifreload mgmt-bo
148+
$ nmcli device
149+
DEVICE TYPE STATE CONNECTION
150+
mgmt-br bridge connected bridge-mgmt
151+
...
152+
mgmt-bo bond connected bond-mgmt
153+
ens6 ethernet connected bond-slave-ens6
154+
ens7 ethernet connected bond-slave-ens7
131155
```
132156
133-
:::caution
134-
135-
A mistake in the configuration may disrupt the SSH session.
157+
### Configuration persistence
136158
137-
:::
159+
:::note
138160
139-
### Configuration persistence
161+
If you upgrade from a version before `v1.7.0`, the changes below need to be made in the `/oem/91_networkmanager.yaml` file instead of in `/oem/90_custom.yaml`.
140162
163+
:::
141164
142165
1. Backup the elemental cloud-init file `/oem/90_custom.yaml` as follows:
143166
144167
```
145168
cp /oem/90_custom.yaml /oem/install/90_custom.yaml.$(date --iso-8601=minutes)
146169
```
147170
148-
1. Edit `/oem/90_custom.yaml` and update the yaml path `stages.initramfs[0].files`. More specifically, update the content of the `/etc/sysconfig/network/ifcfg-mgmt-bo` file and edit the `BONDING_SLAVE_X` and `BONDING_MODULE_OPTS` entries accordingly:
171+
1. Edit `/oem/90_custom.yaml` and add a entry under `stages.initramfs[0].files` to create the NetworkManager connection profile for the new device. The most straightforward thing to do is to copy an existing bonding slave device and update the `path`, `id` and `interface-name` fields to match the new device. The following example shows the creation of `/etc/NetworkManager/system-connections/bond-slave-ens7.nmconnection` based on the existing `/etc/NetworkManager/system-connections/bond-slave-ens6.nmconnection` connection profile:
149172
150173
```
151174
stages:
152175
initramfs:
153-
- ...
154-
files:
155-
- path: /etc/sysconfig/network/ifcfg-mgmt-bo
156-
permissions: 384
157-
owner: 0
158-
group: 0
159-
content: |+
160-
STARTMODE='onboot'
161-
BONDING_MASTER='yes'
162-
BOOTPROTO='none'
163-
POST_UP_SCRIPT="wicked:setup_bond.sh"
164-
165-
166-
BONDING_SLAVE_0='ens5'
167-
BONDING_SLAVE_1='ens6'
168-
169-
BONDING_MODULE_OPTS='miimon=100 mode=balance-tlb '
170-
171-
DHCLIENT_SET_DEFAULT_ROUTE='no'
172-
173-
encoding: ""
174-
ownerstring: ""
175-
- path: /etc/sysconfig/network/ifcfg-ens6
176-
permissions: 384
177-
owner: 0
178-
group: 0
179-
content: |
180-
STARTMODE='hotplug'
181-
BOOTPROTO='none'
182-
encoding: ""
183-
ownerstring: ""
184-
```
185-
186-
:::note
187-
188-
If you didn't select an interface during installation, you must add an entry to initialize the interface. Please check the `/etc/sysconfig/network/ifcfg-ens6` file creation in the above example. The file name should be `/etc/sysconfig/network/ifcfg-<interface-name>`.
189-
190-
:::
176+
- files:
177+
- ...
178+
- path: /etc/NetworkManager/system-connections/bond-slave-ens6.nmconnection
179+
permissions: 384
180+
owner: 0
181+
group: 0
182+
content: |
183+
[connection]
184+
id=bond-slave-ens6
185+
type=ethernet
186+
interface-name=ens6
187+
master=mgmt-bo
188+
slave-type=bond
189+
encoding: ""
190+
ownerstring: ""
191+
- path: /etc/NetworkManager/system-connections/bond-slave-ens7.nmconnection
192+
permissions: 384
193+
owner: 0
194+
group: 0
195+
content: |
196+
[connection]
197+
id=bond-slave-ens7
198+
type=ethernet
199+
interface-name=ens7
200+
master=mgmt-bo
201+
slave-type=bond
202+
encoding: ""
203+
ownerstring: ""
204+
- ...
205+
```

docs/logging/harvester-logging.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ In Harvester's practice, the `Logging`, `Audit` and `Event` shares one architect
4747
The Harvester logging infrastructure allows you to aggregate Harvester logs into an external service such as [Graylog](https://www.graylog.org), [Elasticsearch](https://www.elastic.co/elasticsearch/), [Splunk](https://www.splunk.com/), [Grafana Loki](https://grafana.com/oss/loki/) and others.
4848

4949
### Collected Logs
50+
5051
See below for a list logs that are collected:
5152
- Logs from all cluster `Pods`
5253
- Kernel logs from each `node`
@@ -55,7 +56,7 @@ See below for a list logs that are collected:
5556
- `rke2-agent`
5657
- `rancherd`
5758
- `rancher-system-agent`
58-
- `wicked`
59+
- `NetworkManager`
5960
- `iscsid`
6061

6162
:::note

docs/networking/best-practice.md

Lines changed: 24 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -45,28 +45,40 @@ Before any action is taken, it is important to collect the current network infor
4545
Example: A NIC named `ens3` was added to the `mgmt-bo` bond interface.
4646

4747
```
48-
- path: /etc/sysconfig/network/ifcfg-mgmt-bo
48+
- path: /etc/NetworkManager/system-connections/bond-mgmt.nmconnection
4949
permissions: 384
5050
owner: 0
5151
group: 0
52-
content: |+
53-
STARTMODE='onboot'
54-
BONDING_MASTER='yes'
55-
BOOTPROTO='none'
56-
POST_UP_SCRIPT="wicked:setup_bond.sh"
57-
BONDING_SLAVE_0='ens3'
58-
BONDING_MODULE_OPTS='miimon=100 mode=active-backup '
59-
DHCLIENT_SET_DEFAULT_ROUTE='no'
52+
content: |-
53+
[connection]
54+
id=bond-mgmt
55+
type=bond
56+
interface-name=mgmt-bo
57+
master=mgmt-br
58+
slave-type=bridge
59+
60+
[ethernet]
61+
62+
[bond]
63+
miimon=100
64+
mode=active-backup
65+
66+
[bridge-port]
67+
vlans=1 pvid untagged
6068
encoding: ""
6169
ownerstring: ""
6270
63-
- path: /etc/sysconfig/network/ifcfg-ens3
71+
- path: /etc/NetworkManager/system-connections/bond-slave-ens3.nmconnection
6472
permissions: 384
6573
owner: 0
6674
group: 0
6775
content: |
68-
STARTMODE='hotplug'
69-
BOOTPROTO='none'
76+
[connection]
77+
id=bond-slave-ens3
78+
type=ethernet
79+
interface-name=ens3
80+
master=mgmt-bo
81+
slave-type=bond
7082
encoding: ""
7183
ownerstring: ""
7284
```

0 commit comments

Comments
 (0)