Metal as a Service - The Life of a DevOps Engineer

Metal as a Service

Installing Tinkerbell using docker-compose. (VIDEO COMING SOON!!!)

Lets get Tinkerbell installed... we will want to start with a 22.04 Ubuntu server... and lets install the pre-reqs. This will pull down the sandbox repository on GitHub to your local machine and I will show you how to deploy Tinkerbell on Docker. I have also installed on Vagrant and can show that process if anyone would like.

Prerequisites

  • Docker.io

  • Docker-Compose

  • Git


sudo apt install docker.io

sudo apt install docker-compose

sudo apt install git

Installation

Lets just work out of our home directory for our user. When we clone the repo we will get a 'sandbox' folder created from where we run it.


git clone https://github.com/tinkerbell/sandbox.git

cd sandbox/deploy/stack/compose/

The most important values you provide at first installation is your HOST_IP, the CLIENT_IP and CLIENT_MAC address for targeting. You can use export commands (and don't forget to source) or you can edit the .env file within the compose directory.

vi .env

and add these values below. You will want to target your environment's IP's and MAC address.

TINKERBELL_CLIENT_IP=192.168.86.26

TINKERBELL_CLIENT_MAC=b8:ca:3a:bb:ea:04

TINKERBELL_HOST_IP=192.168.86.33

Now we are ready to run docker-compose to bring up the sandbox environment.


sudo docker-compose up -d


After pulling images and bringing up the environment (pulling images will take a few moments, and fetching and converting Ubuntu will take a while), you can check the containers with docker ps.


sudo docker ps


Hard to get a shot of the docker output, here is a screenshot

We can check on logs of containers with a docker command for logs

sudo docker logs 87e4e7a9522d

Testing

We can check our client machine now for PXE booting and see if Tinkerbell's boots container discovers the MAC address that we configured.

SUCCESS!

(Next we will produce a workflow and initaiate a job. I will show you how to use Tinkerbell commands through the docker environment to valiate hardware, templates and workflows.)



We will next go through the Hardware, Template and Workflow configuration and administation.

Check back soon or bug me about it!


MORE FUN STUFF!


PXE with netboot.xyz

A lot of the time you will need a way to network boot metal... as easy implementation is netboot.xyz's efi file (or appropriate file for you) and a delivery system... dhcp,PXE config and TFTP, which can be accomplished with dnsmasq on Ubuntu.

dnsmasq is commonly used as a dns cache and local forwarder... you can enable a few commands to broadcast PXE and respond with offerings to clients.

update /etc/dhcpd.conf as follows:

dhcp-range=START_IP_RANGE,END_IP_RANGE,12h

dhcp-host=HOST_MACADDRESS,HOST_IP,HOSTNAME

dhcp-boot=/pxeboot/netboot.xyz.efi

enable-tftp

tftp-root=/pxeboot

I used a range of only the server I was targeting for development / rebuild and ended it there... 10.15.20.120,10.15.20.120,12h

The hostname and macaddress give data to the PXE offer and allow you to target a specific adapter on a machine.

We can get the files for this by downloading them through curl and prepping with folder creation. Lets use root as dnsmasq runs as it and this is likely an on premise provisioning engine that is relatively secured internally (NOT IT IF NOT):

mkdir /pxeboot

Lets grab the netboot.xyz file:

curl -o /pxeboot/netboot.xyz.efi https://boot.netboot.xyz/ipxe/netboot.xyz.efi

Restart dnsmasq and you should be good to go!

service dnsmasq restart



Kube Management