Kubernetes on Bare Metal with Talos, Cilium BGP and MetalLB
Kubernetes on bare metal means you own the node OS, the control-plane VIP, external Service IPs and storage that a cloud provider normally hides. This playbook designs that platform with Talos immutable nodes, Cilium eBPF networking with BGP, MetalLB where it still earns its place, and storage matched to replication needs.
1. What Kubernetes on Bare Metal Really Changes
Kubernetes on bare metal removes the cloud control plane, cloud load balancer and cloud CSI driver, so you must design node lifecycle, API high availability, Service IP announcement and storage yourself. The payoff is predictable performance and cost, but every failure domain becomes visible and yours to operate.
Consider an illustrative composite incident, drawn from common bare-metal failure patterns rather than a named outage. A team runs three control-plane nodes and six workers in one rack. A top-of-rack switch reboots during maintenance, BGP sessions flap, and every LoadBalancer Service stays reachable from inside the cluster while external clients time out. Pods are healthy, endpoints are populated, and dashboards stay green. The fault sits outside Kubernetes: routes were withdrawn, ECMP hashing moved flows to a node that no longer advertises the VIP, and no one owned the router configuration as code. That gap between a healthy cluster and a reachable platform is the core design problem.
Cloud Kubernetes hides four mechanisms. The provider patches node images, materialises a load balancer when you create a Service, attaches network storage through a CSI driver, and gives the API server a managed endpoint. On owned hardware none of that exists until you build it. Kubernetes itself does not include a load-balancing component for bare metal, so a Service of type LoadBalancer stays pending until MetalLB, Cilium LB-IPAM or a similar implementation allocates and announces an address.
The practical consequence is that platform design starts below Kubernetes. Power domains, switch redundancy, NIC bonding, disk layout and firmware all shape cluster behaviour. A single switch or a single power feed turns a three-node control plane into one failure domain. Senior operators therefore treat the rack, the router and the storage network as part of the cluster architecture, with the same change control and observability they apply to workloads.
This article follows that order: node OS first, then control-plane reachability, then Cilium and Service announcement, then storage, then upgrades and troubleshooting. If you already run managed Kubernetes well, the workload skills transfer directly. The new skill is owning the layers underneath without turning every node into a hand-tuned snowflake.
2. Node Design for Kubernetes on Bare Metal with Talos
For kubernetes on bare metal, Talos Linux gives you immutable, API-managed nodes with no SSH, shell or package manager, which removes drift and shrinks attack surface. You declare each node in YAML, apply it over mTLS, and replace the image atomically instead of patching packages in place.
Talos treats the operating system as a single artifact. The root filesystem is read-only, state lives on dedicated STATE and EPHEMERAL partitions, and all management goes through a gRPC API on port 50000 using talosctl with mutual TLS. There is no interactive login to audit and no apt or yum history to reconstruct after an incident. Configuration drift becomes structurally difficult because there is no shell session in which to drift.
That model suits owned hardware. Generate machine configurations for control-plane and worker roles, keep them in Git, and apply them declaratively. Node replacement becomes a provisioning exercise rather than a repair exercise: boot the Talos image, apply the machine config, let the kubelet join, and drain the old node. Atomic A/B upgrades with automatic revert on failure remove the classic failure where one node ends up half-patched after a reboot.
The trade-off is debuggability, and it is real. You cannot SSH in and install tcpdump. Instead you use talosctl dmesg, logs, services and pcap, plus privileged debug pods or system extensions baked through Image Factory when you need extra tooling. Teams that rely on ad hoc host surgery will feel constrained for the first month. Teams that already run GitOps usually adapt quickly because the constraint matches how they work.
Compare this with kubeadm on a general-purpose distro. Kubeadm gives you full host access and familiar systemd tooling, which helps when a vendor agent demands a shell. It also leaves patching, kernel tuning and kubelet flag drift to your automation. If you need that flexibility, read the kubeadm cluster administration guide for join, drain and upgrade discipline. For a new bare-metal fleet, Talos usually wins on operability; for a fleet with mandated host agents, kubeadm may be the honest choice.
3. Control Plane High Availability for Kubernetes on Bare Metal
Kubernetes on bare metal needs three or five control-plane nodes across separate power and switch domains, a stable API VIP, and fast etcd disks. Quorum only helps when failures are independent, so rack placement and disk latency matter as much as node count in production.
Etcd quorum is arithmetic with physical consequences. Three members tolerate one failure, five tolerate two, and any even number wastes a node without adding tolerance. Placement decides whether that arithmetic holds. Three control-plane nodes behind one switch or one power strip fail together, which converts a highly available design into a single point of failure with extra cost. Spread members across racks, power feeds and switches wherever the facility allows it.
Clients and workers need one stable API endpoint. Options include a Talos-managed VIP, kube-vip announcing the API address, or a hardware or software load balancer in front of the API servers. Whatever you choose, test the failover while a node is down, not just while all nodes are healthy. A VIP that moves slowly or points at a dead API server during a rolling upgrade will stall every controller that depends on the API.
Disk choice quietly decides etcd health. Etcd is sensitive to fsync latency, and shared spinning disks or busy network storage produce leader elections that look like random API slowness. Give control-plane nodes fast local NVMe, keep etcd data off disks shared with heavy workload IO, and monitor WAL fsync duration and backend commit latency. The etcd backup and restore guide covers snapshot discipline; on bare metal you also own the hardware that makes those snapshots meaningful.
Keep workloads off control-plane nodes by default. Talos already bars user workloads there unless you allow scheduling, which limits blast radius when a privileged DaemonSet misbehaves. Size control-plane nodes for API and etcd load, not for application pods, and resist the temptation to borrow their capacity during a traffic spike.
4. Networking Foundations: Kubernetes on Bare Metal Needs Explicit Routing
Kubernetes on bare metal networking must be designed explicitly: bonded NICs, a pod CIDR that does not collide with site networks, and a routing plan for Service IPs. Cloud overlays hide these choices, while owned hardware exposes every subnet, VLAN and switch limitation immediately.
Start with address planning. Reserve non-overlapping ranges for node IPs, pod CIDRs, Service ClusterIPs and external LoadBalancer pools, and write them down before the first node boots. Overlapping ranges cause failures that mimic CNI bugs: pods reach some destinations and not others, return traffic takes a different path, and troubleshooting burns hours on the wrong layer. Treat IPAM as an architecture decision, not an installer default.
Bond physical NICs where the hardware allows it, and decide whether storage traffic shares the same links as pod traffic. Replicated storage and BGP-advertised Services both compete for bandwidth during failures, which is exactly when you need headroom. Separate storage VLANs or dedicated interfaces keep a volume rebuild from starving application traffic. At minimum, measure link saturation during a node drain before you trust the design.
Decide early whether pod IPs stay inside an overlay or get routed natively. Native routing with Cilium can advertise pod CIDRs to top-of-rack switches, which simplifies debugging and avoids encapsulation overhead, but it requires router cooperation and careful CIDR allocation per node. Overlay modes work anywhere and isolate the pod network, at the cost of an extra encapsulation layer to reason about during packet-level debugging.
Document the network as code. Switch configurations, BGP peerings, VLAN assignments and firewall rules belong in version control with the same review process as cluster manifests. The illustrative incident at the start of this article happened because the router was treated as someone else's problem. On bare metal, the router is part of your platform whether you claim it or not.
5. Cilium eBPF Networking for Kubernetes on Bare Metal
Cilium suits kubernetes on bare metal because eBPF replaces kube-proxy, enforces NetworkPolicy in the kernel, and can announce Service IPs over BGP from the CNI you already run. Fewer moving parts means fewer DaemonSets to upgrade and one datapath to observe during incidents.
Cilium loads eBPF programs into the kernel to handle service load balancing, policy enforcement and observability without iptables rule sprawl. With kube-proxy replacement enabled, Service traffic is handled in the eBPF datapath, which scales better than large iptables chains and gives you Hubble flow visibility for debugging. For mechanism depth, see the Kubernetes CNI explainer on iptables, Calico, Cilium and eBPF trade-offs.
On Talos, wire Cilium to KubePrism. Enable KubePrism in the machine config, disable the built-in proxy, and point Cilium at 127.0.0.1 on port 7445 so agents reach the API through the local load-balanced endpoint. This detail matters during control-plane churn: agents keep a stable API path even when individual API servers restart. Host DNS forwarding through Talos also helps node-level resolution stay consistent.
Choose the routing mode deliberately. Tunnel mode encapsulates pod traffic and works on almost any network, which helps when switches cannot learn pod routes. Native routing mode forwards pod packets without encapsulation and can integrate with BGP, which suits facilities where you control the top-of-rack switches. Native mode demands non-overlapping pod CIDRs and router configuration that matches; tunnel mode demands MTU discipline so encapsulated packets do not fragment.
Validate the datapath before workloads arrive. Run Cilium connectivity tests, check that NetworkPolicy actually drops denied traffic, and confirm that Hubble shows flows for a test Service. A CNI that passes a smoke test but silently ignores policy is worse than one that fails loudly, because the failure surfaces during a security review or an incident.
6. Service IPs: Cilium BGP vs MetalLB for Kubernetes on Bare Metal
On kubernetes on bare metal, a LoadBalancer Service needs an allocator and an announcer: MetalLB or Cilium LB-IPAM assigns the IP, then Layer 2 ARP or BGP tells the network where to send traffic. BGP with ECMP spreads load, while Layer 2 stays simpler.
Split the problem into two jobs. Allocation hands out addresses from a pool you reserve, such as a MetalLB IPAddressPool or a CiliumLoadBalancerIPPool. Announcement tells the network which node should receive traffic for that address. Layer 2 mode elects one node to answer ARP or NDP requests, so all traffic for a Service enters through that node. BGP mode opens sessions to your routers and advertises routes, letting the router hash flows across advertising nodes with ECMP.
Layer 2 is the pragmatic starting point when you cannot change router configuration. It needs nodes and clients on the same Layer 2 segment, fails over by moving the IP and sending gratuitous ARP, and typically recovers within seconds. Its limits are structural: one node's bandwidth caps each Service, and failover depends on clients honouring the new ARP mapping. For background on Service types, see the Kubernetes Services explainer.
BGP removes the single-node bottleneck. Every node hosting a backend pod can advertise the Service IP, routers spread connections across them, and a node failure withdraws its route automatically. The cost is operational: you need BGP-capable routers, an AS number for the cluster, peer configuration, and resilient ECMP hashing so a membership change does not reset unrelated flows. When a node leaves, its active connections still reset; ingress retries and client backoff soften that impact.
Cilium can absorb both jobs when it is already your CNI. LB-IPAM allocates addresses and the BGP control plane advertises them, so you run no extra speaker DaemonSet. MetalLB remains attractive when you want a CNI-agnostic load balancer or when its FRR-K8s BGP backend matches your network team's skills. Running both announcers for the same pool is a reliable way to create flapping routes, so pick one owner per pool and enforce it in review.
7. MetalLB in Practice: Kubernetes on Bare Metal Without Router Control
MetalLB fits kubernetes on bare metal when you lack router control or want load balancing independent of the CNI. Use Layer 2 for a single segment, BGP when peers exist, and reserve a dedicated IP pool that DHCP and other systems will never allocate.
Install MetalLB in its own namespace, reserve an address pool outside DHCP ranges, and advertise it with exactly one mode per pool. An L2Advertisement makes the pool reachable by ARP or NDP; a BGPAdvertisement with BGPPeer resources makes it reachable through routing. Mixing modes on one pool without a clear reason produces behaviour that is hard to predict during failover, so keep pools purpose-specific: one for ingress, one for internal Services, each with its own advertisement.
Speaker placement matters. Speakers run as a DaemonSet and need host networking to answer ARP or hold BGP sessions. On Talos this works without host changes because the DaemonSet carries its own privileges through Kubernetes, but you should still verify that speakers land on nodes connected to the right VLAN. A speaker on a node with no path to the client segment will win an election it cannot serve.
Recent MetalLB releases use FRR-K8s as the default BGP backend, which means even Layer 2 clusters may carry extra routing components. That overhead is usually acceptable, but it strengthens the case for evaluating Cilium LB-IPAM if Cilium is already your CNI. The decision is operational, not ideological: count the DaemonSets you upgrade, the logs you read during an incident, and the skills on your team.
Test announcement failure, not just success. Kill the speaker pod on the elected node, drain a node hosting backends, and watch how long external clients keep working. Measure the gap with a continuous probe from outside the cluster network. A load balancer design that has only been tested in steady state is an assumption, not a capability.
8. Storage Choices for Kubernetes on Bare Metal
Storage for kubernetes on bare metal splits into local volumes for self-replicating systems, Longhorn for simpler replicated volumes, and Rook-Ceph for larger clusters needing block, file and object. Match the choice to replication needs, node count and the storage skills you actually have.
Local storage is the fastest and simplest option. TopoLVM, OpenEBS LocalPV or a local-path provisioner creates a volume on one node's disk and pins the pod there through topology-aware scheduling. That pinning is a feature for databases that replicate themselves, such as a PostgreSQL primary with standbys or a Kafka cluster, because the application already handles redundancy and network replication would only add latency. The cost is clear: lose the node and the volume is unavailable until the node returns or the application promotes a replica elsewhere.
Longhorn replicates each volume across nodes over the network and presents a standard CSI interface, which suits small to medium clusters that want replicated volumes without operating Ceph. Replication consumes network bandwidth and CPU on every write, so a fast, quiet inter-node link is not optional. Longhorn also needs enough nodes for its replica placement to survive a failure; three nodes is the practical floor for meaningful redundancy.
Rook-Ceph runs a full Ceph cluster inside Kubernetes and provides block, ReadWriteMany file and S3-compatible object storage from one system. It suits larger clusters with several disks per node and a team willing to learn Ceph operations: OSD placement, CRUSH behaviour, scrubbing and recovery throttling. Ceph guidance assumes 10 Gbps-class networking, and recovery traffic after a disk failure can saturate slower links for hours. Choose Ceph when its breadth earns that operational weight.
Whatever you pick, keep storage disks separate from OS disks, set StorageClass binding to WaitForFirstConsumer for local volumes so scheduling and provisioning agree, and test restore from backup before production data lands. The Kubernetes storage guide covers PVC, StorageClass and CSI mechanics that sit underneath every option here.
9. Comparison: Kubernetes on Bare Metal Design Decisions
The kubernetes on bare metal decisions that matter are node OS, Service announcement and storage replication, and each has a defensible default. Talos, BGP where routers allow it, and storage matched to application replication cover most production clusters without exotic tooling or extra layers.
Use the table below as a decision aid, not a ranking. Every row trades operational effort against capability, and the right answer depends on constraints you can state plainly: do you control the routers, how many nodes and disks do you have, and which systems replicate their own data. A design that names its constraints survives contact with an incident better than one copied from a reference architecture.
Two patterns deserve explicit rejection. Running MetalLB and Cilium BGP against the same pool invites route flapping, because two controllers announce the same address with different logic. Running replicated storage underneath a database that already replicates synchronously doubles write cost and complicates failure reasoning; local volumes plus application replication is usually cleaner. Both mistakes come from layering tools without assigning each job a single owner.
Size the platform for failure, not for steady state. A cluster that needs every node to meet peak load has no capacity to drain a node for upgrades. Keep headroom for one worker loss during peak, test that headroom with a drain drill, and treat the drill result as a capacity requirement. Bare-metal capacity planning is unforgiving because new hardware takes weeks, not minutes.
| Decision | Option A | Option B | Choose when |
|---|---|---|---|
| Node OS | Talos immutable API-managed | kubeadm on general distro | Talos for new fleets; kubeadm when host agents need a shell |
| Service announcement | BGP with ECMP | Layer 2 ARP/NDP | BGP when you control routers; Layer 2 on one segment |
| LB owner | Cilium LB-IPAM plus BGP | MetalLB pools | Cilium when Cilium is the CNI; MetalLB for CNI independence |
| Storage | Local volumes (TopoLVM/LocalPV) | Longhorn or Rook-Ceph | Local for self-replicating apps; replicated for shared state |
| Control plane | 3 or 5 nodes across domains | Single node | Three minimum for production quorum |
10. Upgrades and Day-2 Operations for Kubernetes on Bare Metal
Day-2 work for kubernetes on bare metal means image-based node upgrades, one-node-at-a-time drains, and etcd snapshots taken before changes. Talos upgrades replace the OS image atomically, while Kubernetes upgrades roll through nodes only after workloads prove they tolerate a drain.
Upgrade in layers and never all at once. Take an etcd snapshot, upgrade one control-plane node, verify API health and etcd membership, then continue. Talos OS upgrades apply a new image and reboot into it, reverting automatically if the node fails to come back healthy. Kubernetes version upgrades follow the same rhythm: drain, upgrade, uncordon, watch workloads reschedule, then move to the next node.
Drain behaviour exposes application weaknesses. Pods without PodDisruptionBudgets can all terminate together, and stateful pods pinned to local volumes cannot move at all. Fix those definitions before the upgrade window, not during it. A pre-upgrade drain drill on a staging cluster, or a cordon test in production during low traffic, tells you which workloads will block the maintenance.
Keep firmware and switch changes in the same calendar as cluster changes. A BIOS update that resets NIC settings or a switch firmware upgrade that changes ECMP hashing can break a healthy cluster without any Kubernetes change. Record firmware versions in your inventory, stage switch changes one device at a time, and keep a rollback path that does not depend on the cluster being reachable.
Automate node replacement until it is boring. Provisioning a replacement Talos node should be a documented sequence with expected timings: boot image, apply config, join cluster, verify Cilium and storage agents, then return the node to service. When replacement is routine, hardware failure becomes a ticket instead of an emergency.
11. Troubleshooting Kubernetes on Bare Metal Platforms
Troubleshooting kubernetes on bare metal works layer by layer: check routes and ARP before pods, etcd latency before API complaints, and disk health before storage errors. Most bare-metal incidents live below Kubernetes, so prove each lower layer healthy before changing workloads.
Start outside the cluster. If external clients fail while in-cluster tests pass, inspect announcement first: is the Service IP allocated, is a speaker or Cilium agent advertising it, and does the router hold the route. Layer 2 failures often trace to a speaker elected on the wrong VLAN or clients ignoring gratuitous ARP. BGP failures trace to session state, AS mismatches or route filters that silently drop the prefix.
API slowness on bare metal usually means etcd distress. Check WAL fsync duration, backend commit latency and disk utilisation on control-plane nodes before blaming the API server. A single slow disk can trigger leader elections that present as random timeouts across every controller. Correlate etcd metrics with storage rebuilds or backup jobs that share the same disks.
Storage incidents need the same discipline. A PVC stuck pending with WaitForFirstConsumer often means no node satisfies topology and capacity together, which is a scheduling answer rather than a CSI failure. Volume attach errors after a node failure usually mean the old attachment was never cleaned up. Read CSI controller logs and node events together; either one alone tells half the story.
Keep a runbook that maps symptoms to first commands. The matrix below is a starting point for your own version, tuned to your switches, storage and announcement mode. Review it after every incident and delete steps that never help, because a runbook nobody trusts gets ignored when it matters.
| Symptom | Likely layer | First checks | Fix direction |
|---|---|---|---|
| LoadBalancer pending | Allocation | Pool ranges, LB-IPAM or MetalLB controller logs | Free or expand the pool, fix pool selectors |
| External timeout, pods healthy | Announcement | ARP table, BGP session state, route presence | Repair speaker placement or BGP peering |
| API timeouts in bursts | etcd and disks | WAL fsync, commit latency, disk saturation | Move etcd to fast local NVMe, stop IO contention |
| PVC pending | Scheduling and CSI | Topology, node capacity, CSI controller logs | Align StorageClass binding and node labels |
| Node NotReady after upgrade | Node OS | talosctl dmesg, services, kubelet logs | Roll back image, check NIC and disk detection |
| One Service slow, others fine | Layer 2 bottleneck | Elected node bandwidth, flow distribution | Move the pool to BGP with ECMP |
12. Production Checklist for Kubernetes on Bare Metal
A production kubernetes on bare metal platform is ready when node replacement, VIP failover, Service announcement and storage restore have all been drilled, not merely configured. Use this checklist to prove each mechanism under failure before real traffic depends on it.
Work through the checklist in order and record evidence for each item: a timestamp, a command output or a dashboard link. Bare-metal platforms fail at the seams between teams, so evidence matters more than intent. If an item cannot be evidenced, treat it as unfinished regardless of how confident the design review felt.
For multi-team platforms, decide tenancy boundaries before onboarding. Namespaces with quotas and NetworkPolicy cover many cases, while virtual clusters suit teams that need stronger isolation; the Kubernetes multi-tenancy guide compares those models. On bare metal, tenancy mistakes are expensive because capacity cannot be borrowed from a cloud account while you fix them.
Revisit the design quarterly against reality. Node count, traffic patterns and storage growth change which trade-offs still hold. A Layer 2 pool that was fine at one gigabit may need BGP after a traffic doubling, and a Longhorn cluster that grew past a dozen nodes may justify Ceph. Platform architecture on owned hardware is a living decision, reviewed on a schedule rather than rediscovered during an outage.
- [ ] Three or five control-plane nodes across separate power and switch domains
- [ ] API VIP failover drilled with one control-plane node down
- [ ] Talos machine configs in Git, node replacement timed and documented
- [ ] Cilium connectivity and NetworkPolicy enforcement verified
- [ ] One owner per LoadBalancer pool, announcement failover probed externally
- [ ] Storage restore from backup completed on a test volume
- [ ] etcd snapshot taken and restore rehearsed
- [ ] Drain drill passed for every production workload
- [ ] Switch and BGP configuration version-controlled
- [ ] Capacity headroom proven with one worker drained at peak
Frequently Asked Questions
Is kubernetes on bare metal cheaper than managed Kubernetes?
Hardware cost per unit of compute is usually lower, but you pay in operations: node lifecycle, load balancing, storage and hardware replacement become your team's work. Bare metal wins financially when utilisation stays high and the team already runs platform engineering. It loses when clusters sit idle or when a small team spends its time on hardware instead of product work. Compare total cost including on-call load, spares and refresh cycles, not just server prices.
Why use Talos for kubernetes on bare metal instead of Ubuntu with kubeadm?
Talos removes SSH, shell and package management, so nodes cannot drift and upgrades replace the whole image atomically with automatic revert. That shrinks attack surface and makes node replacement repeatable. Ubuntu with kubeadm keeps familiar host access, which helps when vendor agents need a shell, but patching and flag drift become your automation problem. Choose Talos for new fleets you fully control, and kubeadm when host-level flexibility is a hard requirement.
Should kubernetes on bare metal use Cilium BGP or MetalLB?
Use Cilium LB-IPAM with its BGP control plane when Cilium is already your CNI and you control BGP-capable routers, because it removes an extra speaker DaemonSet. Use MetalLB when you want load balancing independent of the CNI, need Layer 2 on a single segment, or your network team prefers its FRR-K8s backend. Never announce the same pool from both systems, since competing announcements flap routes.
What is the difference between Layer 2 and BGP announcement on bare metal?
Layer 2 elects one node to answer ARP or NDP for a Service IP, so all traffic enters through that node and failover moves the address with gratuitous ARP. BGP advertises routes to your routers, which spread flows across advertising nodes with ECMP and withdraw routes automatically on failure. Layer 2 needs no router changes; BGP needs peers, an AS number and resilient hashing.
Which storage should kubernetes on bare metal use for databases?
Databases that replicate themselves, such as PostgreSQL with standbys or Kafka, usually run best on local volumes from TopoLVM or OpenEBS LocalPV, because application replication already provides redundancy without network write cost. Systems that cannot replicate themselves need replicated storage such as Longhorn, or Rook-Ceph on larger clusters. Always test restore from backup, since replication alone does not protect against deletion or corruption.
How many nodes does a production kubernetes on bare metal cluster need?
Three control-plane nodes is the production minimum for etcd quorum, placed across separate power and switch domains, plus enough workers to lose one at peak load without breaching capacity. Five control-plane nodes suit larger or more critical platforms. A single-node cluster is a lab, not production, because any maintenance or hardware fault becomes downtime. Size workers from a drain drill rather than from steady-state utilisation alone.
Why does a LoadBalancer Service stay pending on kubernetes on bare metal?
Kubernetes ships no bare-metal load balancer, so the Service waits until an implementation such as MetalLB or Cilium LB-IPAM allocates an address from a pool. Pending usually means no pool exists, the pool is exhausted, or pool selectors do not match the Service. Check controller logs and pool capacity first, then confirm the announcement mode can reach clients on the right segment or through BGP.
Preparing for Senior Platform & SRE Interviews
Practice real-world cluster triage, RBAC debugging, and pod scheduling scenarios in our Kubernetes scenario interview questions hub.
Explore Interview Scenarios →