Kubernetes cluster ready for my server
- kubernetes-dashboard
- longhorn
- Metallb
- Traefik
- node-exporter
- victoria-metrics
- ...
- Exclude some ip's from your dhcp-pool. Put them to metallb config
- Add Traefik's IP to your DNS
- Change all DNSs in the repo. You can find it with
nb3.mesubstring - Add DNS wildcard to your DNS-server (ex.:
*.k8s.home.nb3.me) - Install Ubuntu 20.04 to your system
sudo apt install wireguard
- Go to
IP -> DNS - Go to Static section
- Add new with
.*\.k8s\.home\.nb3\.mevalue and pointing to the network selected (192.168.5.200for me)
On your host:
On all hosts add cgroup_enable=cpuset cgroup_enable=memory cgroup_memory=1 to /boot/firmware/cmdline.txt
On 1st master:
curl -sfL https://get.k3s.io | INSTALL_K3S_CHANNEL=latest INSTALL_K3S_EXEC="--disable traefik,local-storage,servicelb --cluster-domain k8s.home.nb3.me --flannel-backend=wireguard --cluster-init" sh -
# copy content to ~/.kube/config and change address
cat /etc/rancher/k3s/k3s.yaml
# copy token for slave
cat /var/lib/rancher/k3s/server/node-tokenOn else master nodes:
curl -sfL https://get.k3s.io | INSTALL_K3S_CHANNEL=latest K3S_TOKEN=TOKEN-FROM-MASTER INSTALL_K3S_EXEC="server --server https://master01:6443 --disable traefik,local-storage,servicelb --cluster-domain k8s.home.nb3.me --flannel-backend=wireguard" sh -On slave:
curl -sfL https://get.k3s.io | INSTALL_K3S_CHANNEL=latest K3S_URL=https://master01:6443 K3S_TOKEN=TOKEN-FROM-MASTER sh -helmfile applyEnabled, but you need a token to enter
# Add account and role
kubectl apply -f charts/kubernetes-dashboard/account.yaml
# Extract token
kubectl -n kubernetes-dashboard describe secret $(kubectl -n kubernetes-dashboard get secret | grep admin-user | awk '{print $1}')# Add ingrees route
kubectl apply -f charts/traefik-dashboard/ingressroute.yamlAlready enabled
# Only once, install upgrader
kubectl apply -f charts/system-upgrade/system-upgrade.yaml
# Apply update plan
kubectl apply -f charts/system-upgrade/k3s-plans.yaml