Add iec auto deployment scripts & Fix some bugs
[iec.git] / scripts / setup-cni.sh
1 #!/bin/bash
2 set -o xtrace
3 set -e
4
5 CLUSTER_IP=${1:-172.16.1.136} # Align with the value in our K8s setup script
6
7 # Install the Etcd Database
8 if [ "$(uname -m)" == 'aarch64' ]; then
9   ETCD_YAML=etcd-arm64.yaml
10 else
11   ETCD_YAML=etcd-amd64.yaml
12 if
13
14 sed -i "s/10.96.232.136/${CLUSTER_IP}/" "cni/calico/${ETCD_YAML}"
15 kubectl apply -f "cni/calico/${ETCD_YAML}"
16
17 # Install the RBAC Roles required for Calico
18 kubectl apply -f "cni/calico/rbac.yaml"
19
20 # Install Calico to system
21 sed -i "s/10.96.232.136/${CLUSTER_IP}/" cni/calico/calico.yaml
22 kubectl apply -f cni/calico/calico.yaml
23
24 # Remove the taints on master node
25 kubectl taint nodes --all node-role.kubernetes.io/master- || true