22
33<!-- cSpell:ignore htpasswd,virsh -->
44
5- This guide has been tested on Ubuntu server 22 .04. It should be seen as an
5+ This guide has been tested on Ubuntu server 24 .04. It should be seen as an
66example rather than the absolute truth about how to deploy and use Metal3. We
77will cover two environments and two scenarios. The environments are
88
@@ -79,24 +79,14 @@ and the MAC address:
7979Start by defining a libvirt network:
8080
8181``` xml
82- <network >
83- <name >baremetal</name >
84- <forward mode =' nat' >
85- <nat >
86- <port start =' 1024' end =' 65535' />
87- </nat >
88- </forward >
89- <bridge name =' metal3' />
90- <ip address =' 192.168.222.1' netmask =' 255.255.255.0' >
91- </ip >
92- </network >
82+ {{#embed-github repo:"metal3-io/metal3-docs" branch:"main" path:"docs/user-guide/examples/net.xml"}}
9383```
9484
9585Save this as ` net.xml ` , define it and start it.
9686
9787``` bash
9888virsh -c qemu:///system net-define net.xml
99- virsh -c qemu:///system net-start baremetal
89+ virsh -c qemu:///system net-start baremetal-e2e
10090```
10191
10292Next, we will create a virtual machine. Feel free to adjust at as you see fit,
@@ -130,11 +120,7 @@ the form of [sushy-tools](https://docs.openstack.org/sushy/latest/).
130120We need to create configuration file first:
131121
132122``` conf
133- # Listen on 192.168.222.1:8000
134- SUSHY_EMULATOR_LISTEN_IP = u'192.168.222.1'
135- SUSHY_EMULATOR_LISTEN_PORT = 8000
136- # The libvirt URI to use. This option enables libvirt driver.
137- SUSHY_EMULATOR_LIBVIRT_URI = u'qemu:///system'
123+ {{#embed-github repo:"metal3-io/metal3-docs" branch:"main" path:"docs/user-guide/examples/sushy-emulator.conf"}}
138124```
139125
140126``` bash
@@ -164,22 +150,7 @@ note that this is absolutely not intended for production environments.
164150We will use the following configuration file for kind, save it as ` kind.yaml ` :
165151
166152``` yaml
167- kind : Cluster
168- apiVersion : kind.x-k8s.io/v1alpha4
169- nodes :
170- - role : control-plane
171- # Open ports for Ironic
172- extraPortMappings :
173- # Ironic httpd
174- - containerPort : 6180
175- hostPort : 6180
176- listenAddress : " 0.0.0.0"
177- protocol : TCP
178- # Ironic API
179- - containerPort : 6385
180- hostPort : 6385
181- listenAddress : " 0.0.0.0"
182- protocol : TCP
153+ {{#embed-github repo:"metal3-io/metal3-docs" branch:"main" path:"docs/user-guide/examples/kind.yaml"}}
183154```
184155
185156As you can see, it has a few ports forwarded from the host. This is to make
@@ -195,22 +166,23 @@ We will need to install cert-manager also. It will be used to manage the
195166certificates for Ironic later.
196167
197168``` bash
198- kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.3 /cert-manager.yaml
169+ kubectl apply -f https://github.com/cert-manager/cert-manager/releases/latest/download /cert-manager.yaml
199170```
200171
201172### DHCP server
202173
203174The BareMetalHosts must be able to call back to Ironic when going through the
204175inspection phase. This means that they must have IP addresses in a network where
205- they can reach Ironic. We will set up a DHCP server for this purpose .
176+ they can reach Ironic. Any DHCP server can be used for this.
206177
207- Any DHCP server can be used for this. We will here use the Ironic container
208- image that incudes dnsmasq and some scripts for configuring it.
209-
210- Create a configuration file and save it as ` dnsmasq.env ` .
178+ For the virtualized environment, we rely on the libvirt network to provide the DHCP server.
211179
212180Baremetal lab:
213181
182+ We will here use the Ironic container
183+ image that incudes dnsmasq and some scripts for configuring it.
184+ Create a configuration file and save it as ` dnsmasq.env ` .
185+
214186``` bash
215187# The same HTTP port must be provided to all containers!
216188HTTP_PORT=6180
@@ -225,26 +197,6 @@ DHCP_RANGE=192.168.0.100,192.168.0.149
225197GATEWAY_IP=192.168.0.1
226198```
227199
228- Virtualized environment:
229-
230- ``` bash
231- HTTP_PORT=6180
232- DHCP_HOSTS=00:60:2f:31:81:01
233- DHCP_IGNORE=tag:! known
234- # IP of the host from VM perspective
235- PROVISIONING_IP=192.168.222.1
236- GATEWAY_IP=192.168.222.1
237- DHCP_RANGE=192.168.222.100,192.168.222.149
238- ```
239-
240- You can now run the DHCP server like this:
241-
242- ``` bash
243- docker run --name dnsmasq --rm -d --net=host --privileged --user 997:994 \
244- --env-file dnsmasq.env --entrypoint /bin/rundnsmasq \
245- quay.io/metal3-io/ironic
246- ```
247-
248200### Image server
249201
250202In order to do anything useful, we will need a server for hosting disk images
@@ -336,7 +288,7 @@ PROVISIONING_INTERFACE=eth0
336288CACHEURL=http://192.168.222.1/images
337289IRONIC_KERNEL_PARAMS=console=ttyS0
338290# Docker does not allow cross-network access. If using kind to create the management
339- # cluster, explicitly set the external ip and use port forwarding to access ironic services.
291+ # cluster, explicitly set the external ip and use port forwarding to access ironic services.
340292IRONIC_EXTERNAL_IP=192.168.222.1
341293```
342294
@@ -578,7 +530,7 @@ place.
5785301. Deploy cert-manager.
579531
580532 ` ` ` bash
581- kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.14.3 /cert-manager.yaml
533+ kubectl apply -f https://github.com/cert-manager/cert-manager/releases/latest/download /cert-manager.yaml
582534 ` ` `
583535
5845361. Start the DHCP server.
0 commit comments