As part of the HomeLab refresh, I started updating my tools and dependencies, one of the pieces was RancherOS image that I used for running Gitlab runners.
When I tried following my old notes (link) I realised that some commands were no longer working.
I'm experimenting with XCP-ng (xen) this time, so cannot find a way to inject cloud-init on startup. I got the latest rancherOS iso, loaded it to my iso library and booted the newly created vm. Because I couldn't inject the config file directly, I had to find a way to get it to the rancherOS vm. In the old days I would just use python -m SimpleHTTPServer 8000
in the directory with files I wanted to use, but with python 2.x reaching EOL I moved to a modern, python 3.x syntax: python -m http.server 8000
. That command starts a http server in the directory you run it in, so I can access all the files using HTTP protocol from all the machines in my homelab network.
The config file that works, looks like:
#cloud-config
hostname: rancherX
rancher:
network:
interfaces:
eth*:
dhcp: false
eth0:
address: 192.168.0.2/24
gateway: 192.168.0.1
dns:
nameservers:
- 192.168.0.1
ssh_authorized_keys:
- ssh-rsa ASDF..GF==
This config file allows you to quickly set up
- hostname
- static ip
- nameservers
- ssh key for remote access
Now to install the rancherOS you have to run:
sudo ros install -c http://put.your.ip.here:8000/rancher-cloud-config.yml -d /dev/mount_name
I noticed it doesn't allow to run without specifying the mount to install, so seems like the in-memory commands are no longer working