Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added new config in bootstrap.sh #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion kubernetes/bootstrap_master.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"
Expand Down
2 changes: 2 additions & 0 deletions kubernetes/bootstrap_worker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down