Konstantinos Antoniou.

← Projects

Design and Implementation of a Kubernetes Cluster

Overview

I am currently working on deploying and managing a Kubernetes cluster to deepen my understanding of container orchestration and infrastructure automation. My setup consists of three nodes, all running on Proxmox virtual machines hosted in my self hosted home lab. Each node is based on Ubuntu Server 24.04, optimized for lightweight operation and stability.


Cluster Setup

To automate and standardize the installation, I deployed the Kubernetes cluster using Terraform in combination with Kubespray, Terraform was used to provision and configure the virtual machines, ensuring a consistent and scalable infrastructure. Kubespray, an open-source Ansible-based tool, then handled the declarative installation of Kubernetes across the nodes, automating configurations for networking, certificates, and essential addons. This approach provided a fully reproducible and maintainable deployment pipeline.


  • First update the Kubespray repository

git fetch git pull origin master

Screenshot 1: Cluster Setup

Screenshot 2: Cluster Setup

  • Create a python venv for better compatibility
python3 -m venv ~/kubespray-venv
source ~/kubespray-venv/bin/activate
  • Configured the inventory

Screenshot 3: Cluster Setup

  • Run the kubespray

ansible-playbook -i inventory/mycluster/ cluster.yml

Screenshot 4: Cluster Setup

  • After Ansible had finished, i deactivated the venv.

deactivate


My cluster architecture includes

  • 1 Control Plane Node (k8s-ctrl) — manages the Kubernetes API server, controller, and scheduler.
  • 3 Worker Nodes (k8s-node-x) — run containerized workloads and services.
  • Persistent Storage — NFS Subdir External Provisioner: Implements dynamic provisioning of Persistent Volumes (PVs) using my OMV (openmediavault) as external NFS server. The nfs-subdir-external-provisioner automatically creates and manages subdirectories for each Persistent Volume Claim (PVC), ensuring scalable, centralized, and shareable storage across all cluster nodes.
  • Load Balancing and Networking — Load balancing in the Kubernetes cluster is implemented using MetalLB, providing native support for LoadBalancer services on bare-metal infrastructure. Deployed in Layer 2 mode, MetalLB integrates with the Proxmox virtual bridge network, dynamically advertising service IPs to the local network. This architecture delivers production-grade load balancing and efficient traffic routing without relying on external cloud providers, ensuring high availability and consistent internal/external connectivity across nodes.

Screenshot 5: My cluster architecture includes

The nodes are provisioned with Ansible playbooks for consistency and scalability, following the Infrastructure-as-Code (IaC) principle. Each VM is managed directly through Proxmox, giving me the flexibility to snapshot, migrate, and test different configurations without affecting production services.


Learning and Experimentation

Once the base cluster was operational, I began testing and deploying something simple as heimdall dashboard.

For haimdall, i grub the docker-compose.yaml file that i already had for my Docker server and converted to k8s manifests almost ready for deployment.

kompose convert -f /stacks/heimdall/docker-compose.yaml

Screenshot 6: Learning and Experimentation

I gave a  try for more complex deployments but i am still working and learning on k8s. I tried N****extcloud and WordPress for testing multi-container app deployments with persistent storage.

This hands-on project helped me understand  in depth how Kubernetes operates, preparing the ground for future more complex deployments and CI/CD automation.


Next Steps

My next goals include:

  • Migrate all my docker services from my Debian VM to my K8s cluster
  • Experimenting with Github Actions for GitOps-based deployments.

This Kubernetes project is not only a practical lab for learning, but also a foundation for future automation and DevOps experiments in my home infrastructure.

Project is in progress, more news soon…