From 610c96276fae6feb6dcf1c9376cc8699d361012e Mon Sep 17 00:00:00 2001 From: k meher hasanth Date: Sat, 18 Feb 2023 21:38:43 -0500 Subject: [PATCH] added new config in bootstrap.sh --- kubernetes/bootstrap_master.sh | 5 ++++- kubernetes/bootstrap_worker.sh | 2 ++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/kubernetes/bootstrap_master.sh b/kubernetes/bootstrap_master.sh index 88e8169..07e0a37 100644 --- a/kubernetes/bootstrap_master.sh +++ b/kubernetes/bootstrap_master.sh @@ -2,6 +2,8 @@ # Initialize Kubernetes echo "[TASK 1] Initialize Kubernetes Cluster" +rm /etc/containerd/config.toml +systemctl restart containerd kubeadm init --apiserver-advertise-address=172.42.42.100 --pod-network-cidr=192.168.0.0/16 >> /root/kubeinit.log 2>/dev/null # Copy Kube admin config @@ -12,7 +14,8 @@ chown -R vagrant:vagrant /home/vagrant/.kube # Deploy flannel network echo "[TASK 3] Deploy Calico network" -su - vagrant -c "kubectl apply -f https://docs.projectcalico.org/manifests/calico.yaml" +su - vagrant -c "kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.25.0/manifests/tigera-operator.yaml" +su - vagrant -c "kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.25.0/manifests/custom-resources.yaml" # Generate Cluster join command echo "[TASK 4] Generate and save cluster join command to /joincluster.sh" diff --git a/kubernetes/bootstrap_worker.sh b/kubernetes/bootstrap_worker.sh index 4498207..2fc7466 100644 --- a/kubernetes/bootstrap_worker.sh +++ b/kubernetes/bootstrap_worker.sh @@ -2,6 +2,8 @@ # Join worker nodes to the Kubernetes cluster echo "[TASK 1] Join node to Kubernetes Cluster" +rm /etc/containerd/config.toml +systemctl restart containerd apt-get install -y sshpass sshpass -p "kubeadmin" scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no master.example.com:/joincluster.sh /joincluster.sh # sshpass -p "kubeadmin" scp -o StrictHostKeyChecking=no master.example.com:/joincluster.sh /joincluster.sh