Welcome to the Linux Foundation Forum!

Installed Kubeadm on Arch Linux

magnezone150
magnezone150 Posts: 15
edited November 2022 in LFS258 Class Forum

Just sharing for anyone who's curious:

--- Install Arch Linux ---

Note: I've installed this via KVM/Cockpit, Please be mindful that some parts may differ such as locale or /dev/vda could be /dev/sda for your system.

https://archlinux.org/download/

-- On Boot Disk --

ping -c 3 google.ca--> Testing Network Connection
pacman -Syy
cfdisk /dev/vda --> choose label dos and make sure partition is set to bootable with Boot = *
mkfs.ext4 /dev/vda1
mount /dev/vda1 /mnt
lsblk --> Confirm Mount Points
pacstrap /mnt base linux-firmware linux nano vi grub networkmanager openssh wget sudo --> Default is Install All
genfstab -U -p /mnt >> /mnt/etc/fstab
arch-chroot /mnt /bin/bash
nano /etc/locale.gen --> Uncomment en_US.UTF-8 UTF-8
locale-gen
ln -sf /usr/share/zoneinfo/America/Toronto /etc/localtime
hwclock --systohc --utc
echo controlplane > /etc/hostname
nano /etc/hosts
passwd
useradd -mG wheel student
passwd student
grub-install /dev/vda
nano /etc/default/grub --> GRUB_DISABLE_OS_PROBER=false
grub-mkconfig -o /boot/grub/grub.cfg
exit
umount -R /mnt
reboot


-- Install Kubernetes On Arch Linux Controlplane --

systemctl enable NetworkManager
systemctl start NetworkManager
systemctl stop iptables
systemctl diable iptables
visudo --> Uncomment %wheel ALL=(ALL) ALL
sudo pacman -S containerd kubeadm kubelet kube-proxy cni-plugins kubectl openssh
systemctl enable sshd
systemctl start sshd
modprobe overlay
modprobe br_netfilter

cat << EOF | tee /etc/sysctl.d/kubernetes.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
EOF

sysctl --system

wget https://docs.projectcalico.org/manifests/calico.yaml
vi calico.yaml --> "" Line 4552

sudo mkdir /etc/containerd
containerd config default > /etc/containerd/config.toml

sudo sed -i 's/SystemdCgroup \= false/SystemdCgroup \= true/g'

sudo systemctl restart containerd
sudo systemctl enable kubelet
sudo systemctl enable containerd


-- Install Kubernetes On Arch Linux Worker Nodes --

systemctl enable NetworkManager
systemctl start NetworkManager
systemctl stop iptables
systemctl disable iptables
visudo --> Uncomment %wheel ALL=(ALL) ALL
sudo pacman -S containerd kubeadm kubelet kubectl kube-proxy cni-plugins openssh
systemctl enable sshd
systemctl start sshd

modprobe overlay
modprobe br_netfilter

cat << EOF | tee /etc/sysctl.d/kubernetes.conf
net.bridge.bridge-nf-call-ip6tables = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
EOF

sysctl --system

sudo mkdir /etc/containerd
containerd config default > /etc/containerd/config.toml

sudo sed -i 's/SystemdCgroup \= false/SystemdCgroup \= true/g'

sudo systemctl restart containerd
sudo systemctl enable kubelet
sudo systemctl enable containerd
sudo systemctl start kubelet

kubeadm join <IP> --token <Token> --discovery-token-ca-cert-hash sha256:<Hash>

---- Once Workers are Joined into Cluster ----

kubectl label node arch-worker node-role.kubernetes.io/worker=worker
kubectl label node arch-worker2 node-role.kubernetes.io/worker=worker


Comments

Categories

Upcoming Training