Member-only story

Self hosted kubernetes cluster

Mindaugas Ramanauskas
3 min readNov 3, 2023

So what if you found what it is to expensive to host your project on AWS or that every reason you can think of not to use cloud based solutions, here comes self hosted kubernetes cluster.

Hosting provider

Les use OVH.

Hardware

Any at least three servers, ideally 4 and more. With two nic devices. One for public, other for internal traffic. If you are using own servers no need two nic as they will be in DMZ zone anyway. I hope so :)

OS

We will do this on Rocky 9 linux

Installation process.

Let install firewalld on all servers as it not comes in OVH as default packet:

$ sudo dnf install firewalld -y
$ sudo start firewalld
$ sudo enable firewalld

next install kubernetes (on each node):

$ sudo hostnamectl set-hostname k8s-controller-01
$ cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-\$basearch
enabled=1
gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
EOF
$ sudo dnf install -y kubeadm kubectl kubelet
$ sudo dnf install yum-plugin-versionlock -y
$ sudo dnf versionlock kubelet kubeadm kubectl

--

--

No responses yet