DEV Community

Ana Villar
Ana Villar

Posted on Edited on

Building a Kubernetes Cluster on Red Hat Enterprise Linux 10: A kubeadm Guide

Introduction

This is a Kubernetes cluster I built on RHEL 10 in my own lab, using kubeadm, from the upstream Kubernetes and CRI-O documentation. My starting point was Anthony E. Nocentino's excellent Certified Kubernetes Administrator (CKA): Using kubadm to Install a Basic Cluster training course, which is part of the official Certified Kubernetes Administrator (CKA) path on Pluralsight.
His version uses Ubuntu 22.04, and porting it to RHEL 10 turned out to be a much better learning exercise than following along would have been. Everything below is my own configuration; if you want the original course, it's linked above and I recommend it.

One intentional decision in this setup: I deployed Kubernetes v1.35 and CRI-O v1.35, which wasn't the latest version available at installation time.

This was purposeful. Anthony's course includes a dedicated section on upgrading clusters, and using a slightly older baseline makes that learning path clearer.

Lab Infrastructure Overview

Nodes Configuration

Node Role RAM vCPUs IP Address
rh-cp1 Control Plane 12 GiB 2 192.168.110.120
rh-node1 Worker 6 GiB 2 192.168.110.121
rh-node2 Worker 6 GiB 2 192.168.110.122
rh-node3 Worker 6 GiB 2 192.168.110.123

Note: The IP address schema is just an example and what was more convenient for me.

Supporting Infrastructure

A dedicated utilities VM (also RHEL 10) provides essential services:

  • DNS (BIND/named)
  • NTP (chrony)
  • HTTP (Apache/httpd)
  • DHCP (Kea)

This centralized infrastructure simplifies name resolution across all cluster nodes. But this is not essential for this project. You can, instead, ensure the nodes are able to reach each other updating the file /etc/hosts on all nodes.

Prerequisites & OS Preparation

Before diving into Kubernetes, we need consistent node preparation across all machines.

1. System Registration and Updates

$ sudo subscription-manager register --username <username> --password <password>
$ sudo dnf update redhat-release
$ sudo dnf upgrade
$ sudo reboot
Enter fullscreen mode Exit fullscreen mode

2. Disable Swap (Required by Kubernetes)

Edit /etc/fstab to comment out swap entries:

UUID=xxxxxxxx-xxx-xxxx-xxxx-xxxxxxxxxxxx none swap defaults 0 0
# ^ Comment this line out
Enter fullscreen mode Exit fullscreen mode

Verify:

$ sudo swapoff -a
$ free
Enter fullscreen mode Exit fullscreen mode

3. Disable Firewalld

Disable firewalld, as indicated in the