k3s
Cluster 
1# crear master00 y worker00
2# User firewall default
3# Activar red privada
all nodes
#!/usr/bin/env bash
# check root
if [ "$EUID" -ne 0 ];then
echo -e "[+] Please, run $0 as root"
exit -1
fi
sed -i '/::\|The following lines are desirable for IPv6 capable hosts/d' /etc/hosts
# Install packets
apt-get update -qq >/dev/null && apt upgrade -y
apt install -y nano htop sudo curl net-tools open-iscsi nfs-common jq gnupg2 lsb-release git apt-transport-https ca-certificates
# nano
tee /root/.nanorc <<EOF
set constantshow
EOF
# Disable Swap
sed -i '/\/swapfile/d' /etc/fstab
swapoff -a
# sysctl
tee /etc/sysctl.d/kubernetes.conf <<EOF
net.ipv6.conf.all.disable_ipv6 = 1
net.bridge.bridge-nf-call-iptables = 1
net.ipv4.ip_forward = 1
EOF
# Apply & Reboot
apt autoremove -y
sysctl --system
master00
export PUBLICIP="$(ip a show eth0 | awk '/inet / {print $2}' | cut -d/ -f1)"
export PRIVATEIP="$(ip a show eth1 | awk '/inet / {print $2}' | cut -d/ -f1)"
export INSTALL_K3S_EXEC="server \
--disable=traefik \
--flannel-iface=eth1 \
--bind-address $PRIVATEIP \
--advertise-address $PRIVATEIP \
--node-ip $PRIVATEIP \
--node-external-ip $PUBLICIP \
--cluster-init"
curl -sfL https://get.k3s.io | sh -
kubectl get nodes -o wide
joinscript.sh
#!/usr/bin/env bash
#Script para obtener los comandos de unión de un nodo worker a un cluster k3s
export TOKEN=$(cat /var/lib/rancher/k3s/server/node-token)
export PRIVATEIP="$(ip a show eth1 | awk '/inet / {print $2}' | cut -d/ -f1)"
echo -e "[+] Escribe estos comandos en el worker que deseas unir:"
echo -e ""
echo -e "export PRIVATEIP="'$(ip a show eth1 | awk '\''/inet / {print $2}'\'' | cut -d/ -f1)'""
echo -e "export PUBLICIP="'$(ip a show eth0 | awk '\''/inet / {print $2}'\'' | cut -d/ -f1)'""
echo -e "export K3S_URL=\"https://${PRIVATEIP}:6443\""
echo -e "export K3S_TOKEN=\"${TOKEN}\""
echo -e 'export INSTALL_K3S_EXEC="agent --flannel-iface=eth1 --node-ip=$PRIVATEIP --node-external-ip=$PUBLICIP"'
echo -e "curl -sfL https://get.k3s.io | sh -"
echo -e ""
#labels
kubectl label nodes worker00 node-role.kubernetes.io/worker=
kubectl label nodes master00 cpd=CPD1
kubectl label nodes worker00 cpd=CPD2
#Helm
curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3
bash get_helm.sh
#config file
cp /etc/rancher/k3s/k3s.yaml ~/.kube/config
#master
systemctl stop k3s
systemctl disable k3s
bash /usr/local/bin/k3s-uninstall.sh
rm -rf /etc/rancher/
rm -rf /var/lib/rancher/
rm -rf /var/lib/kubelet/
rm -rf /etc/cni/
rm -rf /opt/cni/
rm -rf /var/run/calico/
rm -rf /usr/local/bin/k3s
rm -rf /etc/systemd/system/k3s-agent.service
rm -rf /etc/systemd/system/k3s.service
#worker
kubectl drain worker00 --ignore-daemonsets
kubectl delete node worker00
systemctl stop k3s-agent
systemctl disable k3s-agent
bash /usr/local/bin/k3s-agent-uninstall.sh
#reboot
OldHowto 
https://www.ochobitshacenunbyte.com/2022/04/08/crear-un-entorno-de-kubernetes-en-alta-disponibilidad-con-ubuntu-20-04-y-k3s/
INSTALL_K3S_EXEC="server \
--disable=traefik \
--flannel-iface=eth1 \
--bind-address 10.20.10.2 \
--advertise-address 10.20.10.2 \
--node-ip 10.20.10.2 \
--node-external-ip 79.143.94.183 \
--cluster-init"
/etc/systemd/system/k3s.service
[Unit]
Description=Lightweight Kubernetes
Documentation=https://k3s.io
Wants=network-online.target
After=network-online.target
[Install]
WantedBy=multi-user.target
[Service]
Type=notify
EnvironmentFile=-/etc/default/%N
EnvironmentFile=-/etc/sysconfig/%N
EnvironmentFile=-/etc/systemd/system/k3s.service.env
KillMode=process
Delegate=yes
# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=1048576
LimitNPROC=infinity
LimitCORE=infinity
TasksMax=infinity
TimeoutStartSec=0
Restart=always
RestartSec=5s
ExecStartPre=/bin/sh -xc '! /usr/bin/systemctl is-enabled --quiet nm-cloud-setup.service'
ExecStartPre=-/sbin/modprobe br_netfilter
ExecStartPre=-/sbin/modprobe overlay
ExecStart=/usr/local/bin/k3s \
server \
--disable=traefik \
--flannel-iface=eth1 \
--bind-address 10.20.10.2 \
--advertise-address 10.20.10.2 \
--node-ip 10.20.10.2 \
--node-external-ip 79.143.94.183 \
--cluster-init
systemctl daemon-reload
systemctl restart k3s
kubectl get nodes -o wide