diff --git a/build/images/base/Dockerfile b/build/images/base/Dockerfile index 1d3febf355a..6c1932cc84e 100644 --- a/build/images/base/Dockerfile +++ b/build/images/base/Dockerfile @@ -8,7 +8,7 @@ RUN apt-get update && \ ENV CNI_PLUGINS="./host-local ./loopback ./portmap ./bandwidth" RUN mkdir -p /opt/cni/bin && \ - wget -q -O - https://github.com/containernetworking/plugins/releases/download/v0.8.6/cni-plugins-linux-amd64-v0.8.6.tgz | tar xz -C /opt/cni/bin $CNI_PLUGINS + wget -q -O - https://github.com/containernetworking/plugins/releases/download/v0.8.7/cni-plugins-linux-amd64-v0.8.7.tgz | tar xz -C /opt/cni/bin $CNI_PLUGINS FROM antrea/openvswitch:${OVS_VERSION} diff --git a/build/images/scripts/install_cni b/build/images/scripts/install_cni index be354234d25..2c784b20e82 100755 --- a/build/images/scripts/install_cni +++ b/build/images/scripts/install_cni @@ -15,22 +15,17 @@ install -m 755 /usr/local/bin/antrea-cni /host/opt/cni/bin/antrea # Hence, delete older 10-antrea.conf file. rm -f /host/etc/cni/net.d/10-antrea.conf -# Install the loopback plugin if not already present -# It is required by kubelet on Linux when using docker as the container runtime - -if [ ! -f /host/opt/cni/bin/loopback ]; then - install -m 755 /opt/cni/bin/loopback /host/opt/cni/bin/loopback -fi - -# Install PortMap CNI binary file -if [ ! -f /host/opt/cni/bin/portmap ]; then - install -m 755 /opt/cni/bin/portmap /host/opt/cni/bin/portmap -fi - -# Install bandwidth CNI binary file -if [ ! -f /host/opt/cni/bin/bandwidth ]; then - install -m 755 /opt/cni/bin/bandwidth /host/opt/cni/bin/bandwidth -fi +# Install the loopback plugin. +# It is required by kubelet on Linux when using docker as the container runtime. +# We replace the binary files even they are already present on the Node to make +# sure expected versions are used. +install -m 755 /opt/cni/bin/loopback /host/opt/cni/bin/loopback + +# Install PortMap CNI binary file. It is required to support hostPort. +install -m 755 /opt/cni/bin/portmap /host/opt/cni/bin/portmap + +# Install bandwidth CNI binary file, It is required to support traffic shaping. +install -m 755 /opt/cni/bin/bandwidth /host/opt/cni/bin/bandwidth # Load the OVS kernel module modprobe openvswitch diff --git a/build/images/scripts/install_cni_kind b/build/images/scripts/install_cni_kind index 8674366d421..e96c2110262 100755 --- a/build/images/scripts/install_cni_kind +++ b/build/images/scripts/install_cni_kind @@ -10,19 +10,14 @@ install -m 644 /etc/antrea/antrea-cni.conflist /host/etc/cni/net.d/10-antrea.con # Install Antrea binary file install -m 755 /usr/local/bin/antrea-cni /host/opt/cni/bin/antrea -# Install the loopback plugin if not already present -# It is required by kubelet on Linux when using docker as the container runtime +# Install the loopback plugin. +# It is required by kubelet on Linux when using docker as the container runtime. +# We replace the binary files even they are already present on the Node to make +# sure expected versions are used. +install -m 755 /opt/cni/bin/loopback /host/opt/cni/bin/loopback -if [ ! -f /host/opt/cni/bin/loopback ]; then - install -m 755 /opt/cni/bin/loopback /host/opt/cni/bin/loopback -fi +# Install PortMap CNI binary file. It is required to support hostPort. +install -m 755 /opt/cni/bin/portmap /host/opt/cni/bin/portmap -# Install PortMap CNI binary file -if [ ! -f /host/opt/cni/bin/portmap ]; then - install -m 755 /opt/cni/bin/portmap /host/opt/cni/bin/portmap -fi - -# Install bandwidth CNI binary file -if [ ! -f /host/opt/cni/bin/bandwidth ]; then - install -m 755 /opt/cni/bin/bandwidth /host/opt/cni/bin/bandwidth -fi +# Install bandwidth CNI binary file, It is required to support traffic shaping. +install -m 755 /opt/cni/bin/bandwidth /host/opt/cni/bin/bandwidth