kubernetes-bootstrapping/00-provisioning
2023-12-22 22:29:29 -07:00
..
butane update repository name 2023-12-22 22:29:29 -07:00
ignition update repository name 2023-12-22 22:29:29 -07:00
helpers.sh Separate out helper functions into a file instead of embedded in the readme 2023-12-22 20:22:50 -07:00
README.md Separate out helper functions into a file instead of embedded in the readme 2023-12-22 20:22:50 -07:00

00-Provisioning

Provisioning is the process of creating and installing the machine and operating system to prepare it for workloads. There are many terrafic tools for this, but my needs are simple and I don't like needless abstractions, so I rolled my own found in the *helpers.sh file.

OS of choice is Fedora CoreOS because of all the distributions I've reviewed it seems to be the most lightweight, purpose-built choice that meets requirements.

Lighter

Lighter is a small utility function in helpers.sh I made for templating Butane YAML files, allowing for value substitution. It's a "lighter" method to template compared to something more featurerific like Jinja.

Butane

Butane is a utility for transforming human-readable butane YAML configuration files and transpile them to machine-readable ignition JSON files. The JSON is still readable in many cases, but good luck reading a systemd unit file or anything with more than a few lines

Ignition

Core-OS comes with Ignition which is similar to utilities like cloud-init. Allows completely configuring the system. When adding a new node, or making a change to butane YAML files, be sure to run lighter and pass the node's hostname. It will generate JSON files in the ignition directory which need to be checked into version control. The machine needs to be able to access the files when it boots.

# Be sure to run from 00-provisioning directory
cd 00-provisioning
source helpers.sh

# Run lighter to substitute the machine's hostnames in the butane/full.yaml file, and call butane with each hostname to generate the ignition/*.yaml files
lighter kube-control01
lighter kube-control02
lighter kube-control03
lighter kube-worker01
lighter kube-worker02
lighter kube-worker03

After you've checked the ignition files into version control, provision the server, either on baremetal or VM - example with virtualbox. Use a method to point it to the boot ignition file, in virtual box guest properties can be used.


# Controllers - if doing HA, need at least 3 for Raft concensus
create_vbox_vm kube-control01 "080027000001"
create_vbox_vm kube-control02 "080027000002"
create_vbox_vm kube-control03 "080027000003"

# Workers
create_vbox_vm kube-worker01 "080027000010"
create_vbox_vm kube-worker02 "080027000011"
create_vbox_vm kube-worker03 "080027000012"

If adding a new node or changing MAC address - be sure to update external firewall address objects and external load balancer.