Skip to content

Commit 652b112

Browse files
committed
WIP
Signed-off-by: Lennart Jern <[email protected]>
1 parent 6b0fcdf commit 652b112

File tree

4 files changed

+81
-62
lines changed

4 files changed

+81
-62
lines changed

docs/user-guide/examples/kind.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
apiVersion: kind.x-k8s.io/v1alpha4
2+
kind: Cluster
3+
nodes:
4+
- role: control-plane
5+
# Open ports for Ironic
6+
extraPortMappings:
7+
# Ironic httpd
8+
- containerPort: 6180
9+
hostPort: 6180
10+
listenAddress: "0.0.0.0"
11+
protocol: TCP
12+
# Ironic API
13+
- containerPort: 6385
14+
hostPort: 6385
15+
listenAddress: "0.0.0.0"
16+
protocol: TCP

docs/user-guide/examples/net.xml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
<network>
2+
<name>baremetal-e2e</name>
3+
<forward mode='nat'>
4+
<nat>
5+
<port start='1024' end='65535'/>
6+
</nat>
7+
</forward>
8+
<bridge name='metal3'/>
9+
<ip address='192.168.222.1' netmask='255.255.255.0'>
10+
<dhcp>
11+
<range start='192.168.222.3' end='192.168.222.99'/>
12+
<bootp file='http://192.168.222.2:6180/boot.ipxe'/>
13+
</dhcp>
14+
</ip>
15+
</network>
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
# Listen on the local IP address 192.168.222.1
2+
SUSHY_EMULATOR_LISTEN_IP = u'192.168.222.1'
3+
4+
# Bind to TCP port 8000
5+
SUSHY_EMULATOR_LISTEN_PORT = 8000
6+
7+
# Serve this SSL certificate to the clients
8+
SUSHY_EMULATOR_SSL_CERT = None
9+
10+
# If SSL certificate is being served, this is its RSA private key
11+
SUSHY_EMULATOR_SSL_KEY = None
12+
13+
# The OpenStack cloud ID to use. This option enables OpenStack driver.
14+
SUSHY_EMULATOR_OS_CLOUD = None
15+
# The libvirt URI to use. This option enables libvirt driver.
16+
SUSHY_EMULATOR_LIBVIRT_URI = u'qemu:///system'
17+
18+
# Instruct the libvirt driver to ignore any instructions to
19+
# set the boot device. Allowing the UEFI firmware to instead
20+
# rely on the EFI Boot Manager
21+
# Note: This sets the legacy boot element to dev="fd"
22+
# and relies on the floppy not existing, it likely wont work
23+
# your VM has a floppy drive.
24+
SUSHY_EMULATOR_IGNORE_BOOT_DEVICE = False
25+
26+
# The map of firmware loaders dependant on the boot mode and
27+
# system architecture. Ideally the x86_64 loader will be capable
28+
# of secure boot or not based on the chosen nvram.
29+
SUSHY_EMULATOR_BOOT_LOADER_MAP = {
30+
u'UEFI': {
31+
u'x86_64': u'/usr/share/OVMF/OVMF_CODE.secboot.fd'
32+
},
33+
u'Legacy': {
34+
u'x86_64': None
35+
}
36+
}

docs/user-guide/src/quick-start.md

Lines changed: 14 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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
66
example rather than the absolute truth about how to deploy and use Metal3. We
77
will cover two environments and two scenarios. The environments are
88

@@ -79,24 +79,14 @@ and the MAC address:
7979
Start 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

9585
Save this as `net.xml`, define it and start it.
9686

9787
```bash
9888
virsh -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

10292
Next, 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/).
130120
We 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.
164150
We 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

185156
As 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
195166
certificates 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

203174
The BareMetalHosts must be able to call back to Ironic when going through the
204175
inspection 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

212180
Baremetal 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!
216188
HTTP_PORT=6180
@@ -225,26 +197,6 @@ DHCP_RANGE=192.168.0.100,192.168.0.149
225197
GATEWAY_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

250202
In order to do anything useful, we will need a server for hosting disk images
@@ -336,7 +288,7 @@ PROVISIONING_INTERFACE=eth0
336288
CACHEURL=http://192.168.222.1/images
337289
IRONIC_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.
340292
IRONIC_EXTERNAL_IP=192.168.222.1
341293
```
342294

@@ -578,7 +530,7 @@ place.
578530
1. 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

584536
1. Start the DHCP server.

0 commit comments

Comments
 (0)