Bare-metal Kubernetes vs. Kubernetes on VMs

Once servers have network connectivity (Part I) and programmable out-of-band BMCs (Part II), organizations can run Kubernetes directly on physical servers instead of inside virtual machines. The slides contrast both deployment stacks—using OpenStack VMs as the virtualized reference architecture (PDF pp. 30–31 / printed slides 31–32; see also Lecture 09 - OpenStack and Kubernetes Principles Controllers and Resource Model):

DimensionKubernetes on bare metalKubernetes on VMs (e.g., OpenStack)
Performance & latencyBest — low latency, High-Performance Computing (HPC), no hypervisor overheadSlight hypervisor overhead
Specialized hardwareSimpler direct access to GPUs, FPGAs, and acceleratorsRequires passthrough/virtualization configuration
Resource predictabilityHigher — no hypervisor layer sharing host cores/RAMShared physical host across VMs
Provisioning timeSlow (20–40 minutes) per bare-metal clusterFast (a few minutes) — suits dynamic workloads
Multi-tenancyHard — Kubernetes has poor native multi-tenancyEasy — VM isolation lets each tenant run a separate K8s cluster
Dynamic lifecycle & mixed workloadsHarder to create/delete clusters for A/B testing or projects; containers only unless extendedSupports both plain VMs and Kubernetes on the same infrastructure

Why most Kubernetes deployments still run on VMs

Despite bare metal’s raw performance advantage, most Kubernetes deployments today run on virtual machines for four connected reasons (PDF p. 31 / printed slide 32):

  1. Easy multi-tenant isolation: Rather than hardening a single shared cluster against multi-tenancy limits, operators isolate resources at the VM boundary and give each tenant its own distinct Kubernetes cluster.
  2. Minutes-scale elasticity: Spinning up a VM-backed cluster takes minutes rather than 20–40 minutes for bare-metal provisioning, making dynamic test/project clusters practical.
  3. Unified VM + container infrastructure: Many customers still request traditional VMs alongside Kubernetes on the same hardware pool.

The bare-metal automation challenge

When bare-metal Kubernetes is needed—for instance, in the CrownLabs @ POLITO facility cited as a motivating example (PDF p. 32 / printed slide 33)—manual setup breaks down quickly. Dynamic bare-metal clusters must automate:

  • Node provisioning and de-provisioning: Installing/updating firmware (BIOS) and the OS, installing role-specific Kubernetes components (worker vs. control-plane/master), and taking nodes offline cleanly for software updates or power-off energy savings.
  • Multi-tenancy and VM support (for example via KubeVirt or mixed infrastructure providers).

Cluster API (CAPI)

Cluster API is a Kubernetes project that exposes declarative APIs from a central management Kubernetes cluster to manage the full lifecycle (create, scale, upgrade, destroy) of multiple target Kubernetes clusters across both cloud and on-premises environments (PDF pp. 32–34 / printed slides 33–35; see Declarative Configuration and Idempotency and Kubernetes Extensibility CRDs Operators Webhooks and Drivers).

Analogy: a universal remote for Kubernetes clusters (and its limit)

Think of Cluster API as a universal remote control: you press the same declarative specification (“create a 4-node cluster on Kubernetes version X with CNI/CSI”), and pluggable providers translate that request into concrete API calls for Amazon EKS, VMware, Proxmox, OpenStack, Kubernetes with KubeVirt, or bare metal. Unlike a one-way remote button, Cluster API also runs continuous Kubernetes control loops (Cluster, Machine, MachineDeployment, MachineHealthChecks) that monitor cluster health and perform seamless rolling upgrades (for example from Kubernetes version X to X+1).

Metal3 and its three core components

Metal3 (Metal Kubed) is an open-source, Kubernetes-based project that manages bare-metal infrastructure declaratively—setting up servers, wiping/cleaning disks, installing Linux, configuring networking, and rebooting nodes (PDF pp. 35–36 / printed slides 36–37).

Its defining behavior is continuous declarative reconciliation: when an operator declares “Set-up Server A”, Metal3 inspects Server A’s current condition, drives it to the desired state, and keeps monitoring it. If an external change occurs—such as an administrator manually shutting down or modifying the server through its BMC—Metal3 detects the drift and acts to restore the declared state (PDF p. 35 / printed slide 36).

Metal3 divides this responsibility across three main components inside the management cluster (PDF p. 36 / printed slide 37):

  1. Cluster API Provider Metal3 (CAPM3): The Cluster API infrastructure provider that lets Cluster API create, scale, and delete physical servers just like cloud VMs.
  2. Bare Metal Operator (BMO): The Kubernetes operator that automates bare-metal server provisioning workflows by driving Ironic according to declarative server resources.
  3. Ironic: The core bare-metal provisioning engine (originating in OpenStack) responsible for low-level hardware inspection, OS image deployment, and power/boot control over the management network (BMC).

End-to-end trace: connecting Parts I, II, and III

Tracing a new bare-metal worker node request shows how every layer of the lecture fits together:

StepLayer / ComponentAction
1OperatorDeclares a target cluster (Cluster / MachineDeployment) on the management Kubernetes cluster
2Cluster API + CAPM3Translates Kubernetes machine requests into bare-metal host allocations
3Bare Metal Operator (BMO)Automates provisioning state transitions and hands hardware tasks to Ironic
4Ironic → Management NetworkSpeaks Redfish (or legacy IPMI) to the target server’s BMC IP on the 1G management network
5Server BMCPowers on the server, inspects hardware/BIOS, mounts or streams the Linux + Kubernetes image, and reboots
6Target Bare-Metal NodeBoots Linux + Kubernetes components and joins the target cluster over the high-speed data network

Common confusions

  • Cluster API vs. Metal3: Cluster API manages Kubernetes clusters across any environment (AWS, VMware, OpenStack, bare metal); Metal3 manages bare-metal servers (power, BIOS/HW checks, OS install) and plugs into Cluster API via CAPM3.
  • BMO vs. Ironic: The Bare Metal Operator exposes Kubernetes-native declarative control, while Ironic is the underlying engine that executes actual provisioning and communicates with the server’s BMC.

Retrieval

  1. A platform team hosts 40 independent startup customers who spin clusters up and down hourly, and half of them still ask for traditional Linux VMs. Should the team run Kubernetes on bare metal or on VMs? Give three reasons from the lecture.
    Run Kubernetes on VMs (e.g., over OpenStack): (1) provisioning takes minutes rather than 20–40 minutes for bare metal, matching hourly churn; (2) VM isolation lets each startup run its own separate Kubernetes cluster, bypassing Kubernetes’ weak native multi-tenancy; and (3) the same platform supports both plain VM workloads and Kubernetes clusters.
  2. After provisioning a bare-metal Kubernetes node with Cluster API and Metal3, an operator accidentally opens the server’s BMC web interface and powers the machine off. What happens next, and which Metal3 component interacts directly with the BMC?
    Because Metal3 operates declaratively and continuously monitors server state, it detects that the physical server no longer matches its declared active state and reconciles it back to the desired state. Ironic (driven by the Bare Metal Operator, wired to Cluster API via CAPM3) is the core component that talks directly to the BMC over the management network.
  3. Trace the chain of components from a user requesting a new bare-metal Kubernetes cluster down to the physical server joining the data network.
    User declarative manifest → Management Kubernetes Cluster → Cluster API → Cluster API Provider Metal3 (CAPM3) → Bare Metal Operator (BMO) → Ironic → Redfish/IPMI over the Management Network → target Server BMC (powers on, checks hardware, installs/configures Linux & K8s, reboots) → server joins the Data Network as a cluster node.

Source: Lecture 16 - Managing Bare-Metal Servers, PDF pages 30–36 (printed slides 31–37).