2024-05-03 17:23:27 +03:00
|
|
|
# Universal Blue - Forge
|
2023-04-27 22:40:18 +03:00
|
|
|
|
2024-05-10 23:04:43 +03:00
|
|
|
On-premises Universal Blue. This projects intended is to provide the service units
|
2024-05-03 17:23:27 +03:00
|
|
|
necessary to set up a self-hosted OS forge for custom images.
|
2023-04-27 22:40:18 +03:00
|
|
|
|
2023-05-01 19:30:14 +03:00
|
|
|
> **Warning**
|
|
|
|
> This project is "work in progress" and not ready for production
|
|
|
|
|
2023-04-27 22:40:18 +03:00
|
|
|
## Vision
|
2023-04-27 05:11:52 +03:00
|
|
|
|
|
|
|
Imagine something like a home lab or a university lab:
|
|
|
|
|
|
|
|
1. Deploy forge
|
2023-04-27 22:40:18 +03:00
|
|
|
2. Go into the WebUI, clone in your favorite uBlue repo and make changes
|
|
|
|
3. Forge automatically starts to build the images
|
2023-04-27 05:11:52 +03:00
|
|
|
4. PXE boot the clients, select ublue in the menu
|
|
|
|
5. Eat tacos
|
|
|
|
6. Return to a fully deployed lab with centralized package management
|
|
|
|
|
2023-04-27 22:40:18 +03:00
|
|
|
## What we have so far
|
|
|
|
|
|
|
|
We are still working on making the vision a reality. The following has been
|
|
|
|
implemented so far:
|
|
|
|
|
|
|
|
### Certificate Authority
|
|
|
|
|
|
|
|
We use a [Minica](https://github.com/jsha/minica) as simple CA to generate a
|
|
|
|
key pair and a root certificate for `*.ublue.local`. The wildcard certificate is
|
|
|
|
then made available to all other components and are valid for 2 years and 30 days.
|
|
|
|
|
2023-04-28 21:03:25 +03:00
|
|
|
### Reverse Proxy
|
|
|
|
|
2024-05-10 23:04:43 +03:00
|
|
|
As an entry point for all web components we use [Traefik](https://doc.traefik.io/traefik/)
|
|
|
|
as a reverse proxy. Based on URL routing it will redirect the traffic to the
|
2023-04-28 21:03:25 +03:00
|
|
|
right container instance.
|
|
|
|
|
2024-05-01 11:46:57 +03:00
|
|
|
The reverse proxy dashboard is available at <https://traefik.ublue.local>
|
|
|
|
|
2023-04-27 22:40:18 +03:00
|
|
|
### Container Registry
|
|
|
|
|
|
|
|
As container registry we make use of the [Docker Registry 2.0](https://hub.docker.com/_/registry/)
|
2024-05-10 23:04:43 +03:00
|
|
|
implementation for storing and distributing container images.
|
2023-04-27 22:40:18 +03:00
|
|
|
|
2024-05-01 11:46:57 +03:00
|
|
|
The container registry API is available at <https://registry.ublue.local/v2>
|
|
|
|
|
|
|
|
### Anvil
|
|
|
|
|
|
|
|
The blacksmith's work is done with [Ansible](https://docs.ansible.com/ansible/latest/index.html).
|
|
|
|
|
2024-05-10 23:04:43 +03:00
|
|
|
There are two methods of operating the forge, either via a [GUI](./docs/gui.md) available
|
|
|
|
at <https://forge.ublue.local> or via [just](./docs/just.md) command runner.
|
2023-04-27 05:11:52 +03:00
|
|
|
|
2024-05-10 23:04:43 +03:00
|
|
|
Details about the project and usage instructions are available in the [documentation](./docs/index.md)
|
|
|
|
section.
|
2023-04-27 05:11:52 +03:00
|
|
|
|
2024-05-10 23:04:43 +03:00
|
|
|
## Installation
|
2023-05-04 20:05:33 +03:00
|
|
|
|
2024-05-10 23:04:43 +03:00
|
|
|
### Pre-requisites
|
2024-05-03 17:23:27 +03:00
|
|
|
|
2024-05-10 23:04:43 +03:00
|
|
|
As many tools as possible are built-in but still we rely on some pre-requisites.
|
|
|
|
These tools and service are necessary to get started:
|
2024-05-01 11:46:57 +03:00
|
|
|
|
2024-05-10 23:04:43 +03:00
|
|
|
- [Podman](https://podman.io/)
|
|
|
|
Must be installed and a [podman socket](https://github.com/containers/podman/blob/main/docs/tutorials/socket_activation.md)
|
|
|
|
in the user space must be active.
|
2024-05-03 17:23:27 +03:00
|
|
|
|
2024-05-10 23:04:43 +03:00
|
|
|
- [jq](https://jqlang.github.io/jq/)
|
|
|
|
Must be installed. It it currently needed in the setup process to parse certain parameters
|
|
|
|
automatically for you
|
2024-05-01 11:46:57 +03:00
|
|
|
|
2024-05-10 23:04:43 +03:00
|
|
|
- The kernel parameter `net.ipv4.ip_unprivileged_port_start` must be set to `80`
|
|
|
|
This is because of podman's [shortcoming](https://github.com/containers/podman/blob/main/rootless.md#shortcomings-of-rootless-podman)
|
|
|
|
to bind to ports `< 1024`. Our reverse-proxy is listening on port `80` and `443`
|
|
|
|
for incoming traffic.
|
2024-05-03 17:23:27 +03:00
|
|
|
|
2024-05-10 23:04:43 +03:00
|
|
|
- [OpenSSH](https://www.openssh.com/)
|
|
|
|
Must be installed and the service activated. Ansible needs this to execute all the fancy
|
|
|
|
commands on your host for you.
|
2024-05-03 17:23:27 +03:00
|
|
|
|
2024-05-10 23:04:43 +03:00
|
|
|
### Setup / Heat-Up / Cool-Down
|
2024-05-03 17:23:27 +03:00
|
|
|
|
2024-05-10 23:04:43 +03:00
|
|
|
For the initial setup and maintenance of the forge you can use the [forge.sh](forge.sh) script:
|
2024-05-03 17:23:27 +03:00
|
|
|
|
2024-05-10 23:04:43 +03:00
|
|
|
<!-- markdownlint-disable MD013 -->
|
2024-05-03 17:23:27 +03:00
|
|
|
|
2024-05-10 23:04:43 +03:00
|
|
|
| Command | Description |
|
|
|
|
| ---------------------- | ----------------------------------------------------------- |
|
|
|
|
| `./forge.sh setup` | Setup the forge for the first time or update existing setup |
|
|
|
|
| `./forge.sh heat-up` | Start the forge |
|
|
|
|
| `./forge.sh cool-down` | Stop the forge |
|
2024-05-03 17:23:27 +03:00
|
|
|
|
2024-05-10 23:04:43 +03:00
|
|
|
<!-- markdownlint-enable MD013 -->
|
2024-05-03 17:23:27 +03:00
|
|
|
|
2024-05-10 23:04:43 +03:00
|
|
|
Details about what the setup does can be found [here](./docs/setup.md).
|