modified: docs/k3s-cluster.md
All checks were successful
Monitoring services CI/CD Pipeline / deploy (push) Successful in 23s
Deploy Casa services CI/CD Pipeline / deploy (push) Successful in 21s

This commit is contained in:
2026-01-24 00:46:02 +00:00
parent f655f4f925
commit 28a98ef708

View File

@@ -2,18 +2,12 @@
**Table of Contents:** **Table of Contents:**
- [Nodes](#nodes) - [Master Node](#master-node)
- [Master Node](#master-node) - [Master Node - proxmox vm](#master-node---proxmox-vm)
- [worker node](#worker-node) - [Master Node - network configuration](#master-node---network-configuration)
- [minion01 - worker node](#minion01---worker-node)
## Nodes - [Minion01 - proxmox vm](#minion01---proxmox-vm)
- [Minion01 - k3s -setup](#minion01---k3s--setup)
**Setup user for ssh access:**
``` bash
apt install sudo
usermod -aG sudo mf
```
**Disable swap:** **Disable swap:**
@@ -29,16 +23,48 @@ Edit /etc/fstab and comment out any swap entries:
sudo apt update -y | sudo apt install curl btop -y sudo apt update -y | sudo apt install curl btop -y
``` ```
### Master Node ## Master Node
- debian 12 | Name | Value |
- 2g ram | --- | --- |
- 24Gb disk | **NAME** | casa.dev.lan |
| **VLAN** | casa |
| **IP** | 192.168.14.9 |
| **OS** | Debian GNU/Linux 12 (bookworm) |
| **k3s** | v1.34.3+k3s1 (48ffa7b6) |
| **go** | go1.24.11 |
### Master Node - proxmox vm
*hosted on surfacepro.*
``` yaml
agent: 1
balloon: 0
boot: order=scsi0;ide2;net0
cores: 2
cpu: host
ide2: none,media=cdrom
memory: 2355
meta: creation-qemu=10.1.2,ctime=1762626497
name: casa
net0: virtio=BXX:XX:XX:XX:XX:XX,bridge=vmbr0,tag=xx
numa: 0
onboot: 1
ostype: l26
scsi0: local-lvm:vm-XXX-disk-0,iothread=1,size=24G,ssd=1
scsihw: virtio-scsi-single
smbios1: uuid=cxxxx-xxxx-xxxx-xxxx-xxxx
sockets: 1
usb0: host=1-1.1
```
### Master Node - network configuration
``` bash ``` bash
ip a # check ethernet name ip a # check ethernet name
# removes automatic vonfiguration as dhcp client # removes automatic configuration as dhcp client
sed -i '/ens18/d' /etc/network/interfaces sed -i '/ens18/d' /etc/network/interfaces
cat <<EOF > /etc/network/interfaces.d/ens18 cat <<EOF > /etc/network/interfaces.d/ens18
@@ -68,36 +94,53 @@ kubectl taint nodes <master-node-name> node-role.kubernetes.io/control-plane=:No
kubectl taint nodes casa node-role.kubernetes.io/control-plane=:NoSchedule kubectl taint nodes casa node-role.kubernetes.io/control-plane=:NoSchedule
``` ```
### worker node ## minion01 - worker node
- debian 12 ### Minion01 - proxmox vm
- 4g ram
- 8Gb OS disk
- 16Gb data disk
``` bash *hosted on gaia.*
# execute on server to get token
cat /var/lib/rancher/k3s/server/node-token ```yaml
agent: 1
balloon: 0
boot: order=scsi0;ide2;net0
cores: 4
cpu: host
ide2: none,media=cdrom
memory: 4096
meta: creation-qemu=10.1.2,ctime=1763219351
name: casa-minion-01
net0: virtio=BXX:XX:XX:XX:XX:XX,bridge=vmbr0,tag=xx
numa: 0
onboot: 1
ostype: l26
scsi0: fastcore:vm-XXX-disk-0,iothread=1,size=8G,ssd=1
scsi1: fastcore:vm-XXX-disk-1,iothread=1,size=16G,ssd=1
scsihw: virtio-scsi-single
smbios1: xxxx-xxxx-xxxx-xxxx-xxxx
sockets: 1
``` ```
**Setup worker node:** | Name | Value |
| --- | --- |
| **NAME** | minion01 |
| **VLAN** | casa |
| **IP** | 192.168.14.10 |
| **OS** | Debian GNU/Linux 12 (bookworm) |
| **k3s** | v1.34.3+k3s1 (48ffa7b6) |
| **go** | go1.24.11 |
### Minion01 - k3s -setup
``` bash ``` bash
# install k3s as agent / worker node # install k3s as agent / worker node
# execute on server to get token
# cat /var/lib/rancher/k3s/server/node-token
TOKEN="???" TOKEN="???"
curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="agent --data-dir /dataDisk/k3s --server https://casa.dev.lan:6443 --token ${TOKEN}" sh -s - curl -sfL https://get.k3s.io | INSTALL_K3S_EXEC="agent --data-dir /dataDisk/k3s --server https://casa.dev.lan:6443 --token ${TOKEN}" sh -s -
``` ```
**Move default k3s folder:**
``` bash
apt install rsync
sudo systemctl stop k3s-agent
sudo rsync -a /var/lib/rancher/k3s/ /dataDisk/k3s/
```
Execute install k3s default update script with --data-dir /dataDisk/k3s argument.
Change kubectl -n kube-system edit configmap local-path-config on kube-system to set path to provisioner. Change kubectl -n kube-system edit configmap local-path-config on kube-system to set path to provisioner.
``` yaml ``` yaml
@@ -116,10 +159,6 @@ Change kubectl -n kube-system edit configmap local-path-config on kube-system to
} }
``` ```
``` bash
rm -rf /var/lib/rancher/k3s
```
**Set node labels:** **Set node labels:**
``` bash ``` bash