forked from janssenlima/kubernetes
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathinit_master.sh
More file actions
19 lines (15 loc) · 758 Bytes
/
Copy pathinit_master.sh
File metadata and controls
19 lines (15 loc) · 758 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
# Initialize Kubernetes
echo "[TASK 1] Initialize Kubernetes Cluster"
kubeadm init --apiserver-advertise-address=172.10.10.100 --pod-network-cidr=192.168.0.0/16 >> /root/kubeinit.log 2>/dev/null
# Copy Kube admin config
echo "[TASK 2] Copy kube admin config to Vagrant user .kube directory"
mkdir /home/vagrant/.kube
cp /etc/kubernetes/admin.conf /home/vagrant/.kube/config
chown -R vagrant:vagrant /home/vagrant/.kube
# Deploy plugin network
echo "[TASK 3] Deploy Calico network"
su - vagrant -c "kubectl create -f https://docs.projectcalico.org/v3.11/manifests/calico.yaml"
# Generate Cluster join command
echo "[TASK 4] Generate and save cluster join command to /joincluster.sh"
kubeadm token create --print-join-command > /joincluster.sh