#!/bin/bash
+# shellcheck disable=SC1073,SC1072,SC1039,SC2059,SC2046
set -o xtrace
set -e
CNI_TYPE=${1:-calico}
POD_NETWORK_CIDR=${2:-192.168.0.0/16}
-CLUSTER_IP=${3:-172.16.1.136} # Align with the value in our K8s setup script
-K8S_MASTER_IP=${4:-10.169.41.173}
-SERVICE_CIDR=${5:-172.16.1.0/24}
+K8S_MASTER_IP=${3:-10.169.41.173}
+SERVICE_CIDR=${4:-172.16.1.0/24}
+CLUSTER_IP=${5:-172.16.1.136} # Align with the value in our K8s setup script
DEV_NAME=${6:-}
SCRIPTS_DIR=$(dirname "${BASH_SOURCE[0]}")
install_flannel
}
+
install_cilium(){
${SCRIPTS_DIR}/cni/cilium/cilium_install.sh
# Deploying cilium CNI
kubectl create -f ${SCRIPTS_DIR}/cni/cilium/quick-install.yaml
}
+
+# Remove the taints on master node
+# Taint master before installing the CNI for the case that there is
+# only one master node
+kubectl taint nodes --all node-role.kubernetes.io/master- || true
+
case ${CNI_TYPE} in
'calico')
echo "Install calico ..."
;;
esac
-# Remove the taints on master node
-kubectl taint nodes --all node-role.kubernetes.io/master- || true
#!/bin/bash
+# shellcheck disable=SC1073,SC1072,SC1039,SC2059,SC2046
#Install the k8s-master & k8s-worker node from Mgnt node
#
set -e
#Deploy etcd & CNI from master node
- SETUP_CNI="cd iec/src/foundation/scripts && source setup-cni.sh $CNI_TYPE $POD_NETWORK_CIDR $CLUSTER_IP $K8S_MASTER_IP $SVC_CIDR"
+ SETUP_CNI="cd iec/src/foundation/scripts && source setup-cni.sh $CNI_TYPE $POD_NETWORK_CIDR $K8S_MASTER_IP $SVC_CIDR $CLUSTER_IP"
sshpass -p ${K8S_MASTERPW} ssh -o StrictHostKeyChecking=no ${HOST_USER}@${K8S_MASTER_IP} ${SETUP_CNI}
SETUP_HELM="cd iec/src/foundation/scripts && source helm.sh"
sshpass -p ${K8S_MASTERPW} ssh -o StrictHostKeyChecking=no ${HOST_USER}@${K8S_MASTER_IP} ${SETUP_HELM}