Imagine you want to install OpenShift with the Bare Metal UPI Installation method and you have an environment which does NOT allow you to:
- Pass Ignition or Afterburner Configuration to your Machines
- Set DHCP/PXE boot parameters
- Boot from ISO
...but you CAN:
- Map and set Static IPs
- Manage forward and reverse DNS for your Machines
- Boot a QCow2 or similar VM Image that has the
/ignition.firstboot
file modified with:- A specific DNS server (your with Reverse A records), eg
nameserver=10.128.10.10
- The ignition url set to point to a server, eg
coreos.inst.ignition_url=http://10.128.10.10:8082/ignition-generator
- Learn how to modify a Qcow2 file easily here: https://kenmoini.com/blog/modify_disk_images_with_guestfish/
- A specific DNS server (your with Reverse A records), eg
...then Pilot Light is for you!
Pilot Light is a simple Golang application, which when supplied a config.yml
file and an install-config.yaml
for an OpenShift bare metal install, will generate the needed manifests and Ignition Configs for the cluster and serve them via an HTTP server for Machines that match a hostname pattern as matched from a Reverse DNS query.
$ ./pilot-light [-config file]
An example install-config.yaml
file looks like the following, making sure to change the baseDomain
, metadata.name
, pullSecret
, and sshKey
:
apiVersion: v1
baseDomain: example.com
compute:
- hyperthreading: Enabled
name: worker
replicas: 0
controlPlane:
hyperthreading: Enabled
name: master
replicas: 3
metadata:
name: test
networking:
clusterNetwork:
- cidr: 10.128.0.0/14
hostPrefix: 23
networkType: OpenShiftSDN
serviceNetwork:
- 172.30.0.0/16
platform:
none: {}
fips: false
pullSecret: '{"auths": ...}'
sshKey: 'ssh-ed25519 AAAA...'
A sample config.yml
looks like this:
pilot_light:
version: 0.0.1
asset_directory: ./.generated/
dns_server: 10.128.10.10:53
install_config_path: ./install-config.yaml
masters_schedulable: false
default_ignition_file: bootstrap
server:
host: 0.0.0.0
path: "/generate-manifest"
port: 8082
timeout:
server: 30
read: 15
write: 10
idle: 5
database:
type: local
path: db.sqlite
ignition_sets:
- name: bootstrap
type: bootstrap
hostname_format: bootstrap
- name: control plane
type: master
hostname_format: master
- name: application
type: worker
hostname_format: worker
Running Pilot Light will do the following:
- Create a Generation Directory and subdirectories
- Copy over the
install-config.yaml
file to aconf
directory - Download the OpenShift Install binary, unpack it, create manifests
- [Optional] Set Control Plane nodes to not run workloads
- Create the Ignition Configs
- Start an HTTP Server
- Respond to requests, do a reverse DNS lookup, match hostnames to Ignition Configs