Skip to content

Installation

Alexander Diemand edited this page Jan 7, 2024 · 6 revisions

10 Steps in ten minutes to create a Kubernetes cluster

  1. install Debian to your newly created VM and boot into it

  2. get newest updates: apt update && apt upgrade -y

  3. install some tools: apt install less vim git containerd

    3.1. also turn off swap: swapoff -a

    3.2. disable swap in /etc/fstab:

diff --git a/fstab b/fstab
index e0baa39..5c76d08 100644
--- a/fstab
+++ b/fstab
@@ -11,5 +11,5 @@
 # / was on /dev/sda1 during installation
 UUID=26a279e7-0743-497e-8710-c7a3632402a1 /               ext4    errors=remount-ro 0       1
 # swap was on /dev/sda5 during installation
-UUID=efe4e431-a57d-4a03-83dc-a1dcb5d2de9d none            swap    sw              0       0
+#UUID=efe4e431-a57d-4a03-83dc-a1dcb5d2de9d none            swap    sw              0       0
 /dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0
  1. load modules:
diff --git a/modules b/modules
index d8894c3..784df16 100644
--- a/modules
+++ b/modules
@@ -3,4 +3,5 @@
 # This file contains the names of kernel modules that should be loaded
 # at boot time, one per line. Lines beginning with "#" are ignored.
 # Parameters can be specified after the module name.
-
+overlay
+br_netfilter
  1. enable packet forwarding
diff --git a/sysctl.conf b/sysctl.conf
index eb96ed5..1fa03b9 100644
--- a/sysctl.conf
+++ b/sysctl.conf
@@ -25,7 +25,7 @@
 #net.ipv4.tcp_syncookies=1
 
 # Uncomment the next line to enable packet forwarding for IPv4
-#net.ipv4.ip_forward=1
+net.ipv4.ip_forward=1
 
 # Uncomment the next line to enable packet forwarding for IPv6
 #  Enabling this option disables Stateless Address Autoconfiguration
  1. set cgroup settings in containerd's configuration: containerd config default > /etc/containerd/config.toml
diff --git a/containerd/config.toml b/containerd/config.toml
index a432298..7fd6c57 100644
--- a/containerd/config.toml
+++ b/containerd/config.toml
@@ -122,7 +122,7 @@ version = 2
             NoPivotRoot = false
             Root = ""
             ShimCgroup = ""
-            SystemdCgroup = false
+            SystemdCgroup = true
 
       [plugins."io.containerd.grpc.v1.cri".containerd.untrusted_workload_runtime]
         base_runtime_spec = ""
  1. now is a good time to: reboot

  2. install kubeadm and other tools to manage a Kubernetes cluster as described on kubernetes.io

    8.1. add required packages: apt install -y apt-transport-https ca-certificates curl gpg

    8.2. accept and install the package signature: curl -fsSL https://pkgs.k8s.io/core:/stable:/v1.28/deb/Release.key | gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg

    8.3. add package source: echo 'deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/v1.28/deb/ /' | tee /etc/apt/sources.list.d/kubernetes.list

    8.4. installation: apt update && apt install -y kubelet kubeadm kubectl && apt-mark hold kubelet kubeadm kubectl

  3. now it's ready to: Install Master Node

  4. Add Compute Nodes to a cluster