Skip to content

Commit

Permalink
README revisions
Browse files Browse the repository at this point in the history
  • Loading branch information
jhvst committed Apr 25, 2021
1 parent e8ca0c1 commit e1119e9
Show file tree
Hide file tree
Showing 3 changed files with 43 additions and 9 deletions.
36 changes: 30 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,35 @@
# stateless-fcos
Booting live Fedora CoreOS via iPXE
## Booting live Fedora CoreOS via iPXE

Once upon a time I ran CoreOS machines. Then, CoreOS got bought by RedHat. Then, RedHat got bought by IBM. I was quite happy with it all since I owned RedHat shares.
Once upon a time I ran CoreOS machines. Then, CoreOS got bought by RedHat. Then, RedHat got bought by IBM. I was quite happy with it all. I owned RedHat shares.

Some time after, CoreOS also became Fedora CoreOS. As I evolved my own infra, I found about live booting via iPXE, so I put together an infra.
Next, CoreOS became Fedora CoreOS. When I upgraded to Fedora CoreOS, I found about live booting via iPXE. This was such a hassle that I put up this repository.

This project has all the files for a computer to mimic a router. This is because in my case the inner network is as follows:
## Introduction:

We want to make a boot sequence as follows:

BIOS -> PXE -> iPXE -> Fedora CoreOS

This happens roughly as follows:

```
[Client] [Server]
1. BIOS
2. PXE -> DHCP
3. iPXE <- iPXE image (`undionly.kpxe`)
4. REQ TFTP -> TFTP server
5. iPXE BOOT <- Fedora CoreOS initramfs,kernel
6. REQ Ignition -> HTTP server
7. Fedora CoreOS <- Ignition file, Fedora CoreOS rootfs
8. Successful RAM boot
```

To prepare for successful RAM boot, you may start from `dhcpd` folder.

## Background

My infra is as follows:

```
pfSense router [1]-[2]-[3]-[4]
Expand All @@ -16,6 +40,6 @@ pfSense router [1]-[2]-[3]-[4]
"peli" [1]
```

The idea is that the router has four ports, of which one goes to a node called "muro", which has two ports, of which one goes to a node called "peli". This project has files so that a) "muro" can share the upstream network to "peli" and b) "peli" can boot from "muro", which in itself boots from pfSense.
In other words, my router has four ports. Port 4 goes to a computer `muro` which has two ports. Muro shares WAN and pfSense LAN connection to `peli`.

Throughout the README, the host computer to which the packages are installed is supposed to be "muro" and the computer which is booting PXE is "peli".
`muro` boots CoreOS from pfSense. `peli` boots CoreOS from `muro`. This project demonstrates how `peli` boots from `muro`. As such, throughout the READMEs the packages are installed on `muro` and the computer which is booting PXE is `peli`.
7 changes: 4 additions & 3 deletions http-server/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ BIOS -> PXE -> iPXE -> **Fedora CoreOS**

Any HTTP server will do, but here is one in Python:

1. `podman run -it --cap-add NET_ADMIN --net=host -v $(pwd):/mnt/coreos:Z ubuntu`
2. `apt update && apt install python3`
3. `python3 -m http.server 8014`
1. Look into `ignition/` to see how to produce Ignition files from Butane files.
2. `podman run -it --cap-add NET_ADMIN --net=host -v $(pwd):/mnt/coreos:Z ubuntu`
3. `apt update && apt install python3`
4. `python3 -m http.server 8014`

Leave this server open, and boot into PXE on another computer. The computer should now boot into login prompt of Fedora CoreOS. If you can now close all the containers created during these steps unless you plan on booting more nodes.
9 changes: 9 additions & 0 deletions http-server/ignition/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# ignition

### How-to use

1. Specify Butane files in .bu
2. Acquire Butane-to-Ignition compiler, see, e.g. https://docs.fedoraproject.org/en-US/fedora-coreos/producing-ign/
3. `butane --pretty --strict < example.bu > example.ign`
4. Ensure that the Ignition filename corresponds to that listed in `/ipxe` folder's `.ipxe` files.
5. Start the http-server found in the parent folder.

0 comments on commit e1119e9

Please sign in to comment.