← All posts

8 min read

Turning a 9-year-old Dell PowerEdge R640 into an OpenShift and Ansible Automation Platform lab (part 1)

  • OpenShift
  • KVM
  • RHEL
  • Air-gapped

Building a virtualised, air-gapped OpenShift environment on one 1U server.

Introduction

Ah, the Dell EMC PowerEdge R640. This 9-year-old 1U rack server has been my work partner for the past few weeks now.

Initially, I was tasked with setting up a testing environment for the interns at my company. The objective was to recreate parts of our company's infrastructure, particularly Red Hat OpenShift and Ansible Automation Platform (AAP), in a separate environment where we could experiment, test deployments and learn without affecting production systems.

I had to configure the physical server, prepare its storage, establish virtual networking, deploy multiple virtual machines, configure OpenShift and eventually get AAP running on top of it. What sounded like a straightforward installation quickly turned into a much bigger infrastructure project.


1. Understanding the hardware

Before installing anything, I first had to understand what I was working with. The server was a Dell EMC PowerEdge R640, equipped with the following hardware:

Component Specification
CPU 2 × Intel Xeon Gold 6142 — Skylake-SP, 2.60 GHz, 16 cores / 32 threads each (64 logical CPUs), 44 MiB L3, 2 NUMA nodes
Memory 345 GiB usable — 11 × 32 GiB DDR4-2666 RDIMM (2Rx4, ECC), 11 of 24 slots populated, max 3 TiB
Storage controller Dell PERC H740P Mini (MegaRAID SAS3508)
Storage 1 × 1.09 TiB volume, rotational (HDD-class), presented from a RAID 0 pair
Network 2 × Intel X710 10GbE SFP+ · 4 × Broadcom BCM5719 1GbE · 2 × Intel I350 1GbE (one 1GbE port was the only active uplink)
GPU None — only a Matrox G200eW3 BMC console VGA

The CPU and memory were more than enough for a handful of virtual machines. The disk was the problem. There is one rotational volume, and everything I was about to build would share it.

I made one RAID 0 virtual disk across both drives through the controller's F2 menu, which gives all of the capacity and none of the redundancy. Then I installed RHEL from USB in UEFI mode, starting on 10.2 and later updating to 10.3, and split the volume so guests never touch the root filesystem: 70 GiB for /, 1,012 GiB for /home, plus /boot, an EFI partition and 32 GiB of swap. VM disks live in /home/libvirt/images.

2. One server with three special kubernetes nodes!

So how do you deploy a three-node hybrid cluster on a single machine? Virtual machines, of course!

You might be asking, why not install OpenShift on bare metal? I would have if I could, but I was instructed to recreate the infrastructure as closely as possible to the original, including the three-node cluster setup. And why RHEL as the host OS instead of Proxmox or ESXi? Not going to lie, I completely forgot those were options when I started. By the time I realised, I had already invested too much time to change direction.

So the stack became KVM, QEMU and libvirt:

Dell PowerEdge R640
       |
    RHEL 10.3
       |
  KVM / QEMU  ──►  libvirt  ──►  ocp-nat (virbr-ocp)
       |
  +----+----+----+
  |    |    |    |
Master Master Master
  1     2     3
       |
      AAP
Virtual machine vCPU RAM
Bootstrap (temporary) 4 16 GiB
master-1 / -2 / -3 8 64 GiB

That is 24 vCPU and 192 GiB committed out of 64 and 345, which is a lot to give the control plane. There is no worker tier either, so application pods run on nodes that are also running etcd and the API server.

All three nodes sit on 192.168.100.0/24 with fixed addresses. libvirt does DHCP, DNS and NAT on the virbr-ocp bridge, so the VMs resolve names and reach the outside world through the host's uplink while the cluster network stays separate from the host's own interfaces.

Component Address
Gateway / DNS 192.168.100.1
Registry VIP 192.168.100.5
API VIP 192.168.100.20
Ingress VIP 192.168.100.21
GitLab 192.168.100.22

Those addresses are secondary IPs on the bridge, added by libvirt when it brings ocp-nat up.

DNS has to exist before the installer runs:

api.test.lab.sg          → 192.168.100.20
api-int.test.lab.sg      → 192.168.100.20
*.apps.test.lab.sg       → 192.168.100.21
registry.test.lab.sg     → 192.168.100.5
gitlab.test.lab.sg       → 192.168.100.22
_etcd-server-ssl._tcp    → SRV records for the three masters

The edge sits outside the cluster, on the RHEL host. HAProxy owns 192.168.100.20:6443 and :22623 for the API and Machine Config Server, and 192.168.100.21:80 and :443 for application traffic, forwarding to the masters and the ingress routers so clients always use a consistent name.

GitLab, outside the cluster

GitLab runs on the RHEL host itself, on the bridge address 192.168.100.22, and the OpenShift install never uses it. The AAP playbooks and configuration will live in a Git repository there, so the automation controller can pull from a remote that stays inside the lab. Because it sits on the same bridge as the masters, gitlab.test.lab.sg clones the same from a job pod as it does from the host.

3. Requirements for an air-gapped install

An air-gapped install needs more than an offline cluster. A set of supporting pieces has to exist first, and each one fails loudly if it is missing.

Requirement What it looked like here
Mirror registry registry.test.lab.sg:5000 under Podman, htpasswd auth, 38 GB of blobs
Trust for that registry Self-signed CA covering the hostname and IP, added through additionalTrustBundle
Pull secret including your mirror Quay token extended with the registry's credentials
The payload oc-mirror pulling the release and operator catalogs, with a 37 GiB working directory
Boot images RHCOS ISO, 1.4 GB, attached to each VM
DNS and load balancer The records above, and HAProxy doing real HTTP health checks

The registry has to be reachable from the nodes, not only from wherever you run the installer. One that answers curl on the host and times out from master-3 leaves you watching an install stall at "pulling release image" with no useful error. The trust bundle is not optional either. Skip it and every node fails the same TLS check, one component at a time.

4. The install, in brief

The registry comes first, because nothing can be mirrored until it exists. I ran registry:3 under Podman, bound to the registry VIP, and checked it:

curl -k -u mirror:'<password>' https://registry.test.lab.sg:5000/v2/   # 200
curl -k https://registry.test.lab.sg:5000/v2/                          # 401

A 401 is what you want. Connection refused means the name is not resolving or the container is not bound to the right address, so fix it now rather than during the install.

Then oc-mirror:

oc-mirror --config imageset-config.yaml \
  --workspace file:///root/.oc-mirror docker://registry.test.lab.sg:5000

This is the slow part and it fills the disk. I ended up with 37 GiB of workspace plus 38 GB of registry on a root filesystem with 12 GB free.

Then three control plane VMs and one temporary bootstrap node, each booting the RHCOS ISO with its ignition config on the kernel command line, and an install-config.yaml that looks roughly like this:

apiVersion: v1
baseDomain: lab.sg
metadata:
  name: test           # cluster domain becomes test.lab.sg
platform:
  none: {}             # user-provisioned infrastructure
controlPlane:
  name: master
  replicas: 3
compute:
  - name: worker
    replicas: 0        # no worker tier, masters do both jobs
additionalTrustBundle: |
  -----BEGIN CERTIFICATE-----
  ...
imageContentSources:
  - mirrors:
      - registry.test.lab.sg:5000/openshift/release
    source: quay.io/openshift-release-dev/ocp-release

With compute.replicas: 0 the masters have to be schedulable, or the cluster comes up healthy with nothing running on it:

openshift-install create manifests --dir=ocp
yq -i '.spec.mastersSchedulable = true' ocp/manifests/cluster-scheduler-02-config.yml
openshift-install create ignition-configs --dir=ocp

Then serve the bootstrap ignition over HTTP from the host, start the bootstrap VM, and wait. It took between thirty and forty minutes. After that I added NFS storage, switched authentication to htpasswd, and destroyed the bootstrap node.

What came up: OpenShift 4.22.18, later upgraded to 5.0.1, Kubernetes 1.36.5, RHCOS 9.8, 34 cluster operators, 77 namespaces and 225 pods, with no worker tier.

That's enough rambling

The cluster worked, the storage was there, and the next thing on the list was Ansible Automation Platform. That turned out to be a post of its own, partly because of the operator, partly because of what the environment looked like once I went back and audited it properly.

Most of this post is about waiting for something to finish. The part that actually cost me time was Kubernetes. This was the first cluster I had ever touched, and OpenShift assumes a vocabulary I did not have yet: cluster operators, machine configs, what a node being Ready does and does not tell you. I could follow the install steps without understanding them, and that held up until something broke and I had to learn the concept before I could fix it. Running etcd, the API server and the scheduler on the same three machines reads very differently once you know what each of them is for.

For an old 1U server with no GPU, no redundancy and a BIOS from 2018, the R640 has been put to very good use.

I'll write about how I did the AAP installation next time.