X-Git-Url: https://gerrit.akraino.org/r/gitweb?a=blobdiff_plain;f=src%2Ffoundation%2Fscripts%2Fsetup-cni.sh;h=f0689de462d407e2b81b90e046bd7f63aceffac1;hb=7cd1361ac2e8f3de4ac436129d6ce0ba2785e633;hp=76b963fe66be4d66f52bac099d5c9ff3f1c052f3;hpb=77d0bc5c8e9b9ebcab9f3503db8ee12a404d15c9;p=iec.git diff --git a/src/foundation/scripts/setup-cni.sh b/src/foundation/scripts/setup-cni.sh index 76b963f..f0689de 100755 --- a/src/foundation/scripts/setup-cni.sh +++ b/src/foundation/scripts/setup-cni.sh @@ -1,4 +1,5 @@ #!/bin/bash +# shellcheck disable=SC1073,SC1072,SC1039,SC2059,SC2046 set -o xtrace set -e @@ -10,9 +11,9 @@ fi 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]}") @@ -84,6 +85,16 @@ install_multus_sriov_flannel(){ } +install_multus_sriov_calico(){ + + sed -i "s@10.244.0.0/16@${POD_NETWORK_CIDR}@" \ + "${SCRIPTS_DIR}/cni/multus/multus-sriov-calico/calico-daemonset.yaml" + # Install Multus Calico+SRIOV by yaml files + # shellcheck source=/dev/null + source ${SCRIPTS_DIR}/cni/multus/multus-sriov-calico/install.sh + +} + install_danm(){ ${SCRIPTS_DIR}/cni/danm/danm_install.sh @@ -97,6 +108,19 @@ install_danm(){ 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 ..." @@ -118,15 +142,21 @@ case ${CNI_TYPE} in echo "Install Flannel with SRIOV CNI by Multus-CNI ..." install_multus_sriov_flannel ;; + 'multus-calico-sriov') + echo "Install Calico with SRIOV CNI by Multus-CNI ..." + install_multus_sriov_calico + ;; 'danm') echo "Install danm ..." install_danm ;; + 'cilium') + echo "Install cilium ..." + install_cilium + ;; *) echo "${CNI_TYPE} is not supported" exit 1 ;; esac -# Remove the taints on master node -kubectl taint nodes --all node-role.kubernetes.io/master- || true