Skip to content

Commit bea1584

Browse files
lixiaoyunermssonicbld
authored andcommitted
Install kubernetes-cni for kubelet (sonic-net#14163)
Why I did it Find a new bug on kubelet side. The kubernetes-cni plug-in was removed in sonic-net#12997, the reason is that the plug-in will be auto installed when install kubeadm, and will report error if we don't remove the install code. But after removal, the version auto installed is different from what we installed before. This will affect the kubelet action in some scenarios we don't find before. Need to install it by another way. How I did it Install kubernetes-cni==0.8.7-00 before install kubeadm How to verify it Flannel binary will be installed under /opt/cni/bin/ folder
1 parent 32ac9b0 commit bea1584

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

Makefile.work

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -357,6 +357,7 @@ SONIC_BUILD_INSTRUCTION := make \
357357
SHUTDOWN_BGP_ON_START=$(SHUTDOWN_BGP_ON_START) \
358358
INCLUDE_KUBERNETES=$(INCLUDE_KUBERNETES) \
359359
KUBERNETES_VERSION=$(KUBERNETES_VERSION) \
360+
KUBERNETES_CNI_VERSION=$(KUBERNETES_CNI_VERSION) \
360361
K8s_GCR_IO_PAUSE_VERSION=$(K8s_GCR_IO_PAUSE_VERSION) \
361362
INCLUDE_KUBERNETES_MASTER=$(INCLUDE_KUBERNETES_MASTER) \
362363
SONIC_ENABLE_PFCWD_ON_START=$(ENABLE_PFCWD_ON_START) \

build_debian.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,7 @@ install_kubernetes () {
260260
## Check out the sources list update matches current Debian version
261261
sudo cp files/image_config/kubernetes/kubernetes.list $FILESYSTEM_ROOT/etc/apt/sources.list.d/
262262
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get update
263+
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install kubernetes-cni=${KUBERNETES_CNI_VERSION}
263264
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install kubelet=${ver}
264265
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install kubectl=${ver}
265266
sudo LANG=C chroot $FILESYSTEM_ROOT apt-get -y install kubeadm=${ver}

rules/config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ KUBE_DOCKER_PROXY = http://172.16.1.1:3128/
175175
# NOTE: As a worker node it has to run version compatible to kubernetes master.
176176
#
177177
KUBERNETES_VERSION = 1.22.2-00
178+
KUBERNETES_CNI_VERSION = 0.8.7-00
178179
K8s_GCR_IO_PAUSE_VERSION = 3.5
179180

180181
# INCLUDE_KUBERNETES_MASTER - if set to y kubernetes packages are installed o be able

0 commit comments

Comments
 (0)