Skip to content

Commit 2e91045

Browse files
authored
MGMT-1992 - User guide added for iPXE use case (openshift#402)
* MGMT-1990 Added MVP files to showcast them in oredr to continue or stop the work on this line. Co-authored-by: Avishay Traeger <[email protected]> * MGMT-1992 - User guide added for iPXE use case
1 parent e1fb125 commit 2e91045

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+356
-20
lines changed
+154-1
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,155 @@
11
# Openshift deployment with OAS - On Bare Metal
2-
work in progress...
2+
This guide contains all the sections regarding Bare Metal deployment method, like iPXE/PXE, VirtualMedia, etc... let's get started
3+
4+
## General
5+
6+
This section is generic for the most of the cases:
7+
8+
- DHCP/DNS running on the network you wanna deploy the OCP cluster.
9+
- Assisted Installer up & running (It's ok if you're working with cloud version).
10+
- Typical DNS entries for API VIP and Ingress VIP.
11+
- Pull Secret to reach the OCP Container Images.
12+
- SSH Key pair.
13+
14+
_*Note*: This method could be used also in Virtual environment_
15+
16+
- With that we could start, first step is create the cluster
17+
- Fill the Cluster name and Pull Secret fields, also select the version you wanna deploy:
18+
19+
![img](img/new_cluster.png)
20+
21+
- Now fill the Base Domain field and the SSH Host Public Key
22+
23+
![img](img/entry_base_domain.png)
24+
![img](img/entry_ssh_pub_key.png)
25+
26+
- Click on _Download Discovery ISO_
27+
28+
![img](img/entry_ssh_pub_key.png)
29+
30+
- Fill again the SSH public key and click on _Generate Discovery ISO_
31+
32+
![img](img/entry_ssh_download_discovery.png)
33+
34+
- Wait for ISO generation to finish and you will reach this checkpoint
35+
36+
![img](img/discovery_iso_generated.png)
37+
38+
39+
## iPXE
40+
41+
iPXE deployment method
42+
43+
*NOTE1*: We use a sample URL, please change to fit your use case accordingly
44+
*NOTE2*: We've set the live_url as the node hostname on 8080 port , please change to fit your use case accordingly
45+
46+
### Automatic
47+
48+
The automatic way is done using podman, just follow this steps:
49+
50+
```shell
51+
export IPXE_DIR=/tmp/ipxe/ai
52+
mkdir -p ${IPXE_DIR}
53+
54+
# This command will download the ISO, extract the Images and create the ignition config files
55+
podman run -e BASE_URL=http://devscripts2ipv6.e2e.bos.redhat.com:8080 -e ISO_URL=http://devscripts2ipv6.e2e.bos.redhat.com:6008/api/assisted-install/v1/clusters/33ffb056-ee65-4fee-91c9-f60e5ebea4a3/downloads/image -v /tmp/ipxe/ai:/data:Z --net=host -it --rm quay.io/ohadlevy/ai-ipxe
56+
57+
# This command will host the iPXE files on an podman container
58+
podman run -v ${IPXE_DIR}:/app:ro -p 8080:8080 -d --rm bitnami/nginx:latest
59+
```
60+
61+
To ensure if your container is working fine, check the url with a `curl` command
62+
63+
```shell
64+
curl http://$(hostname):8080/ipxe/ipxe
65+
```
66+
67+
### Manual
68+
69+
The manual way is explained here. You need at least to have the Discovery ISO already generated
70+
71+
Now let's download that ISO in the provisioning machine, where the iPXE files will be hosted (use the _Command to download the ISO_ button from the Assisted Service website
72+
73+
```shell
74+
export IPXE_DIR=/tmp/ipxe/ai
75+
export IMAGE_PATH=/tmp/discovery_image_ocp.iso
76+
77+
wget -O ${IMAGE_PATH} 'http://cloud.redhat.com/api/assisted-install/v1/clusters/<cluster_id>/downloads/image'
78+
```
79+
80+
- Now we need to create the folder and the _ipxe_ file definition
81+
82+
```shell
83+
mkdir -p ${IPXE_DIR}
84+
85+
cat > $IPXE_DIR/ipxe << EOF
86+
#!ipxe
87+
set live_url $(hostname):8080
88+
kernel \${live_url}/vmlinuz ignition.config.url=\${live_url}/config.ign coreos.live.rootfs_url=\${live_url}/rootfs.img ${KERNEL_OPTS}
89+
initrd \${live_url}/initrd.img
90+
boot
91+
EOF
92+
```
93+
94+
- We also need to extract the images from the ISO
95+
96+
```shell
97+
export PXE_IMAGES=`isoinfo -i $IMAGE_PATH -f | grep -i images/pxeboot`
98+
99+
for img in $PXE_IMAGES; do
100+
export name=`basename ${img,,} | sed 's/\;1//' | sed 's/\.$//'`
101+
echo extracting $name
102+
isoinfo -i $IMAGE_PATH -x $img > $IPXE_DIR/$name
103+
done
104+
```
105+
106+
- And as a last step, write the Ignition files for the deployment
107+
108+
```shell
109+
echo writing custom user ignition
110+
echo '{' > $IPXE_DIR/config.ign
111+
isoinfo -i $IMAGE_PATH -x '/IMAGES/IGNITION.IMG;1' | xz -dc - | sed '1d; $d' >> $IPXE_DIR/config.ign
112+
echo '}' >> $IPXE_DIR/config.ign
113+
```
114+
115+
- After the Ignition files creation we need to host the files, for that we will use a podman contianer based on nginx
116+
117+
```shell
118+
podman run -v ${IPXE_DIR}:/app:ro -p 8080:8080 -d --rm bitnami/nginx:latest
119+
```
120+
121+
- To ensure if your container is working fine, check the url with a `curl` command
122+
123+
```shell
124+
curl http://$(hostname):8080/ipxe/ipxe
125+
```
126+
127+
### Booting the nodes from iPXE
128+
129+
- First step, we need to set up the boot mode on the iDrac's as `boot once` for iPXE, this will depend on the steps on every Bare Metal Manufacturer/Version/Hardware.
130+
- When you are booting the nodes, stay tuned to press `crtl-b` when the prompt say that:
131+
132+
![img](img/iPXE_boot.png)
133+
134+
- Now we need to get a correct IP and point to the right iPXE file
135+
- And we just need to wait until the boot was finished, and the nodes start appearing on the Assisted Service interface
136+
137+
![img](img/ipxe_boot.png)
138+
139+
![img](img/boot_from_ipxe.gif)
140+
141+
- Then we will modify the nodename to use a right name for Openshift
142+
143+
![img](img/ai_node_appear.gif)
144+
145+
- Create another 2 more nodes and repeat this step
146+
147+
![img](img/ai_all_nodes.png)
148+
149+
- Now fill the _API Virtual IP_ and _Ingress Virtual IP_ fields
150+
151+
![img](img/ai_vips.png)
152+
153+
- Now you just need to click on _Install Cluster_ button and wait for the installation to finish.
154+
155+

docs/user-guide/img/ai_all_nodes.png

72.6 KB
Loading
119 KB
Loading

docs/user-guide/img/ai_vips.png

18.2 KB
Loading
275 KB
Loading
3.79 KB
Loading
30.1 KB
Loading
61.5 KB
Loading
15.5 KB
Loading
Loading
27.6 KB
Loading

docs/user-guide/img/iPXE_boot.png

10.2 KB
Loading

docs/user-guide/img/ipxe_boot.png

3.84 KB
Loading
9.11 KB
Loading

docs/user-guide/img/new_cluster.png

41.8 KB
Loading
11.5 KB
Loading

docs/user-guide/img/vm_base_OS.png

10.9 KB
Loading
26 KB
Loading

docs/user-guide/img/vm_mem.png

14.4 KB
Loading

docs/user-guide/img/vm_storage.png

23.1 KB
Loading

site/ClusterStatus.dot

+13-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/ClusterStatus.png

29.1 KB
Loading

site/HostStatus.dot

+8-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/HostStatus.png

54.3 KB
Loading

site/index.html

+23-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/search/search_index.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/sitemap.xml

+9-9
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/sitemap.xml.gz

-1 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)