21 lines
1.0 KiB
Bash
21 lines
1.0 KiB
Bash
# Aquest script s'ha de fer servir amb el node agent ja provisionat
|
|
# Anem a buscar el node token al Master
|
|
# sudo cat /var/lib/rancher/k3s/server/node-token
|
|
# Això dóna un string com algun_string_random::server:segon_string_random
|
|
|
|
# NOTA: Executar les següents comandes als nodes que voleu que siguin workers
|
|
# K3S_TOKEN=algun_string_random::server:segon_string_random
|
|
# Quan ja tinguem els nodes preparats i penjats
|
|
# Recordar que 192.168.3.10 és la IP del controlplane
|
|
echo "🚀 Instal·lant K3s Agent (Worker) connectant a 192.168.3.10..."
|
|
|
|
curl -sfL https://get.k3s.io | K3S_URL=https://192.168.3.10:6443 K3S_TOKEN=$K3S_TOKEN sh -
|
|
|
|
echo "✅ Worker unit al clúster!"
|
|
|
|
|
|
#Executar això al Controplane, per tenir-los amb role de worker
|
|
#kubectl label node worker-node01 node-role.kubernetes.io/worker=worker
|
|
#kubectl label node worker-node02 node-role.kubernetes.io/worker=worker
|
|
#Desactivar que al node controlplane es puguin executar pods
|
|
#kubectl taint nodes controlplane node-role.kubernetes.io/master=true:NoSchedule |