From fa2f9d9d6207dc11db01e150564eb1eac359536c Mon Sep 17 00:00:00 2001 From: Jakub Darmach Date: Tue, 17 May 2022 12:46:58 +0200 Subject: [PATCH] Containerd cni plugin path in CoreOS 35 Task: 45387 Story: 2010041 In Fedora CoreOS 35 default containerd cni bin_dir is set to /usr/libexec/cni. Since we're installing our own in /opt/cni/bin need to override in containerd config.toml otherwise pods get stuck in ContainerCreating state looking for for ex. calico in wrong path. Change-Id: I3242b718e32c92942ac471bc7e182a42e803005b (cherry picked from commit 968859984125e62d487896c301d81825580926c4) (cherry picked from commit 87ec546621ae2fc7094ecfe0d910f7d74fd3acf6) --- .../common/templates/kubernetes/fragments/install-cri.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/magnum/drivers/common/templates/kubernetes/fragments/install-cri.sh b/magnum/drivers/common/templates/kubernetes/fragments/install-cri.sh index f60efe47a8..61204fe47a 100644 --- a/magnum/drivers/common/templates/kubernetes/fragments/install-cri.sh +++ b/magnum/drivers/common/templates/kubernetes/fragments/install-cri.sh @@ -10,6 +10,9 @@ ssh_cmd="ssh -F /srv/magnum/.ssh/config root@localhost" if [ "${CONTAINER_RUNTIME}" = "containerd" ] ; then $ssh_cmd systemctl disable docker.service docker.socket $ssh_cmd systemctl stop docker.service docker.socket + if $ssh_cmd [ -f /etc/containerd/config.toml ] ; then + $ssh_cmd sed -i 's/bin_dir.*$/bin_dir\ =\ \""\/opt\/cni\/bin\/"\"/' /etc/containerd/config.toml + fi if [ -z "${CONTAINERD_TARBALL_URL}" ] ; then CONTAINERD_TARBALL_URL="https://github.com/containerd/containerd/releases/download/v${CONTAINERD_VERSION}/cri-containerd-cni-${CONTAINERD_VERSION}-linux-amd64.tar.gz" fi