mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-09-27 13:15:36 +00:00
Merge pull request #122178 from saschagrunert/cni-plugins
Update cni-plugins to v1.4.0
This commit is contained in:
@@ -54,7 +54,7 @@ LIMITED_SWAP=${LIMITED_SWAP:-""}
|
||||
|
||||
# required for cni installation
|
||||
CNI_CONFIG_DIR=${CNI_CONFIG_DIR:-/etc/cni/net.d}
|
||||
CNI_PLUGINS_VERSION=${CNI_PLUGINS_VERSION:-"v1.3.0"}
|
||||
CNI_PLUGINS_VERSION=${CNI_PLUGINS_VERSION:-"v1.4.0"}
|
||||
# The arch of the CNI binary, if not set, will be fetched based on the value of `uname -m`
|
||||
CNI_TARGETARCH=${CNI_TARGETARCH:-""}
|
||||
CNI_PLUGINS_URL="https://github.com/containernetworking/plugins/releases/download"
|
||||
@@ -1180,25 +1180,26 @@ function install_cni {
|
||||
host_arch=$(detect_arch)
|
||||
fi
|
||||
|
||||
cni_plugin_sha=CNI_PLUGINS_${host_arch^^}_SHA256SUM
|
||||
cni_plugin_tarball="${CNI_PLUGINS_VERSION}/cni-plugins-linux-${host_arch}-${CNI_PLUGINS_VERSION}.tgz"
|
||||
cni_plugins_url="${CNI_PLUGINS_URL}/${cni_plugin_tarball}"
|
||||
cni_plugin_tarball="cni-plugins-linux-${host_arch}-${CNI_PLUGINS_VERSION}.tgz"
|
||||
cni_plugins_url="${CNI_PLUGINS_URL}/${CNI_PLUGINS_VERSION}/${cni_plugin_tarball}"
|
||||
cni_plugin_sha_url="${cni_plugins_url}.sha256"
|
||||
|
||||
echo "Installing CNI plugin binaries ..." \
|
||||
&& curl -sSL --retry 5 --output "${TMP_DIR}"/cni."${host_arch}".tgz "${cni_plugins_url}" \
|
||||
&& echo "${!cni_plugin_sha} ${TMP_DIR}/cni.${host_arch}.tgz" | tee "${TMP_DIR}"/cni.sha256 \
|
||||
&& sha256sum --ignore-missing -c "${TMP_DIR}"/cni.sha256 \
|
||||
&& rm -f "${TMP_DIR}"/cni.sha256 \
|
||||
&& sudo mkdir -p /opt/cni/bin \
|
||||
&& sudo tar -C /opt/cni/bin -xzvf "${TMP_DIR}"/cni."${host_arch}".tgz \
|
||||
&& rm -rf "${TMP_DIR}"/cni."${host_arch}".tgz \
|
||||
&& sudo find /opt/cni/bin -type f -not \( \
|
||||
-iname host-local \
|
||||
-o -iname bridge \
|
||||
-o -iname portmap \
|
||||
-o -iname loopback \
|
||||
\) \
|
||||
-delete
|
||||
echo "Installing CNI plugin binaries ..." &&
|
||||
cd "${TMP_DIR}" &&
|
||||
curl -sSL --retry 5 -o "${cni_plugin_tarball}" "${cni_plugins_url}" &&
|
||||
curl -sSL --retry 5 -o "${cni_plugin_tarball}.sha256" "${cni_plugin_sha_url}" &&
|
||||
sha256sum -c "${cni_plugin_tarball}.sha256" &&
|
||||
rm -f "${cni_plugin_tarball}.sha256" &&
|
||||
sudo mkdir -p /opt/cni/bin &&
|
||||
sudo tar -C /opt/cni/bin -xzvf "${cni_plugin_tarball}" &&
|
||||
rm -rf "${cni_plugin_tarball}" &&
|
||||
sudo find /opt/cni/bin -type f -not \( \
|
||||
-iname host-local \
|
||||
-o -iname bridge \
|
||||
-o -iname portmap \
|
||||
-o -iname loopback \
|
||||
\) \
|
||||
-delete
|
||||
|
||||
# containerd 1.4.12 installed by docker in kubekins supports CNI version 0.4.0
|
||||
echo "Configuring cni"
|
||||
|
Reference in New Issue
Block a user