Skip to content

Commit eb1aea9

Browse files
committed
chore(workflow): add cin plugins
1 parent 0262a07 commit eb1aea9

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

_scripts/install.sh

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,26 @@ EOF
7676
fi
7777
}
7878

79+
function install_cin_plugins {
80+
mkdir -p /opt/cni/bin
81+
if [[ "${INSTALL_DRYCC_MIRROR}" == "cn" ]] ; then
82+
cni_plugins_url="https://drycc-mirrors.oss-accelerate.aliyuncs.com/cni/plugins/releases"
83+
else
84+
addons_url="https://github.com/drycc/addons/releases/download/latest/index.yaml"
85+
cni_plugins_url="https://github.com/containernetworking/plugins/releases"
86+
fi
87+
version=$(curl -Ls ${cni_plugins_url}|grep /containernetworking/plugins/releases/tag/ | grep -v no-underline | head -n 1 | cut -d '"' -f 2| awk '{n=split($NF,a,"/");print a[n]}' | awk 'a !~ $0{print}; {a=$0}')
88+
tar_name="cni-plugins-linux-${ARCH}-$version.tgz"
89+
download_url="${cni_plugins_url}/download/${version}/${tar_name}"
90+
curl -fsSL -o "${tar_name}" "${download_url}"
91+
tar -zxvf "${tar_name}" -C /opt/cni/bin
92+
rm -rf "${tar_name}"
93+
}
94+
7995
function install_k3s_server {
8096
configure_os
8197
configure_mirrors
98+
install_cin_plugins
8299
INSTALL_K3S_EXEC="server ${INSTALL_K3S_EXEC} --flannel-backend=none --disable=traefik --disable=local-storage --disable=servicelb --cluster-cidr=10.233.0.0/16"
83100
if [[ -z "${K3S_URL}" ]] ; then
84101
INSTALL_K3S_EXEC="$INSTALL_K3S_EXEC --cluster-init"
@@ -89,6 +106,7 @@ function install_k3s_server {
89106
function install_k3s_agent {
90107
configure_os
91108
configure_mirrors
109+
install_cin_plugins
92110
curl -sfL "${k3s_install_url}" |INSTALL_K3S_EXEC="$INSTALL_K3S_EXEC" sh -s -
93111
}
94112

@@ -98,7 +116,7 @@ function install_components {
98116

99117
echo -e "\\033[32m---> Waiting for helm to install components...\\033[0m"
100118

101-
helm install cilium drycc/cilium --set operator.replicas=1 --namespace kube-system --wait
119+
helm install cilium drycc/cilium --set operator.replicas=1 --set cni.chainingMode=portmap --namespace kube-system --wait
102120
helm install metallb drycc/metallb --namespace kube-system --wait -f - <<EOF
103121
configInline:
104122
address-pools:

0 commit comments

Comments
 (0)