Steps k3s Cluster Configuration
Steps k3s Cluster Configuration
# Disable swap
sudo swapoff -a
sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab
sudo reboot
user is k3s
password is testpostgres
database is k3s
# To use metallb
--no-deploy=servicelb
# To use traefik 2
--no-deploy=traefik
# With etcd
token="d4d8cfa8e5e5d7703b466dddc01d700"
INSTALL_K3S_SKIP_DOWNLOAD=true INSTALL_K3S_EXEC='server --server https://node2:6443
--token '$token' --datastore-endpoint '$K3S_DATASTORE_ENDPOINT' --datastore-cafile
'$K3S_DATASTORE_CAFILE' --datastore-certfile '$K3S_DATASTORE_CERTFILE' --datastore-
keyfile '$K3S_DATASTORE_KEYFILE'' ./install.sh
# The token should be the same on all cluster nodes. To verify the token
cat /var/lib/rancher/k3s/server/node-token
token="K107600156b68cb363c9a2457beff2eb94f7d433f0f97cb66016fb73ec151ea453c::server:
d4d8cfa8e5e5d7703b466dddc01d5332"
k3s_url="https://node2:6443"
INSTALL_K3S_SKIP_DOWNLOAD=true K3S_URL=${k3s_url} INSTALL_K3S_EXEC='agent --server
https://node2:6443 --token '$token'' ./install.sh
# Configure upstream Kubernetes command line tools with the correct kubeconfig path
(This is userd for helm or upstream kubernetes kubectl)
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
# To uninstall k3s
k3s-uninstall.sh
# Configure traefik
sudo kubectl apply -f ./CustomeResourceDefinition.yaml