Added new Vagrant file
This commit is contained in:
@@ -1,9 +1,22 @@
|
||||
echo "🚀 Instal·lant K3s Server (Master)..."
|
||||
curl -sfL https://get.k3s.io | sh -s - --node-ip #{IP_MASTER} --flannel-iface eth1
|
||||
echo "🚀 Instal·lant K3s Server (Master)..."
|
||||
== 1. Update Your System ==
|
||||
sudo apt update
|
||||
sudo apt upgrade -y
|
||||
|
||||
echo "🔑 Guardant el Token a la carpeta compartida..."
|
||||
# Copiem el token a /vagrant (que és la carpeta del teu PC) perquè els workers el vegin
|
||||
sudo cp /var/lib/rancher/k3s/server/node-token /vagrant/node-token
|
||||
sudo chmod 644 /vagrant/node-token
|
||||
== 2. Install k3s ==
|
||||
curl -sfL https://get.k3s.io | sh -
|
||||
|
||||
== 3. Give Non-root User Access to K3s Config ==
|
||||
sudo chown $USER:$USER /etc/rancher/k3s/k3s.yaml
|
||||
export KUBECONFIG=/etc/rancher/k3s/k3s.yaml
|
||||
|
||||
== 4. Verify Kubernetes Cluster ==
|
||||
kubectl version
|
||||
kubectl get nodes
|
||||
kubectl get pods -A
|
||||
|
||||
== 5. Install Kustomize ==
|
||||
curl -s "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh" | bash
|
||||
sudo mv kustomize /usr/local/bin
|
||||
|
||||
echo "✅ Master llest!"
|
||||
echo "✅ Master llest!"
|
||||
Reference in New Issue
Block a user