This commit is contained in:
alessandro
2026-07-17 09:42:52 +02:00
commit 20d506407a
93 changed files with 14526 additions and 0 deletions

61
master_1_installa_rke.sh Normal file
View File

@@ -0,0 +1,61 @@
# 1. Installa RKE2 (script ufficial)
curl -sfL https://get.rke2.io | sh -
sudo systemctl enable rke2-server.service
# 2. Crea config (personalizza token e tls-san se serve)
sudo mkdir -p /etc/rancher/rke2
sudo tee /etc/rancher/rke2/config.yaml > /dev/null <<EOF
# RKE2 Server Configuration - First Master Node
write-kubeconfig-mode: "0644"
# CRITICAL: Add all possible API server access points to the certificate
tls-san:
- "POC-Kube-Balancer"
- "10.20.1.100"
- "POC-Master0"
- "10.20.1.101"
- "POC-Master1"
- "10.20.1.102"
- "POC-Master2"
- "10.20.1.103"
- "POC-Worker0"
- "10.20.1.104"
- "POC-Worker1"
- "10.20.1.105"
- "POC-Worker2"
- "10.20.1.106"
# Network configuration
#cluster-cidr: "10.42.64.0/18"
#service-cidr: "10.42.0.0/18"
#cluster-dns: "10.42.0.10"
# Security hardening
#profile: "cis-1.6"
selinux: true
secrets-encryption: true
# Node configuration
node-taint:
- "CriticalAddonsOnly=true:NoExecute"
ingress-controller: none
EOF
# 3. Avvia RKE2 server
sudo systemctl start rke2-server
# Attendi che i pod kube-system siano up (sul master 1)
#installa kubectl
curl -LO https://dl.k8s.io/release/v1.35.0/bin/linux/amd64/kubectl
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
mkdir /root/.kube
cp /etc/rancher/rke2/rke2.yaml /root/.kube/config
echo "MASTER TOKEN TO COPY"
cat /var/lib/rancher/rke2/server/node-token