Deploy an OpenShift cluster on Linux locally using Ansible and libvirt.
As a solution architect at Red Hat, I want to use a real OpenShift cluster on my - powerful - laptop.
Though there are minishift/CDK and crc/CodeReady Containers, these approaches miss my needs because they install the entire cluster in one big (libvirt/HyperV/VirtualBox/xhyve) virtual machine.
Minishift furthermore uses oc cluster up
to initialize and run the cluster, whereas crc is a comprehensive go application.
What I need and like to hack around with is more advanced functionality (affinity pod placement, killing nodes, distributing workload over multiple nodes).
Here's is my try to get an OpenShift cluster running as per the default recommended installation method.
- Create multiple libvirt VMs for later deployment within a usable kvm network and attached libvirt storage.
- Run the OpenShift OpenShift libvirt installer against these machines.
Not sure if this can be achieved, but I like to implement
- Deployment profiles (
- mini: 1 master, 1 infra, 2 worker;
- default: 2 master, 2 infra, 3 worker;
- ha: 3 (?) master, 3 (?) infra, 4 worker).
- Dynamic host naming convention (later)
- IP range specification
in a way, that the base information can be specified in an external file.
Links to external articles/projects that could be useful:
Bare metal installation of OpenShift (official docs) Ales Nosek: Installing OpenShift 4.1 Using Libvirt and KVM
Red Hat EMEA Services libvirt section for ocp 4
https://github.com/jkhelil/openshift-poc/blob/master/openshift-ansible/README_libvirt.md