From d16209f0f8b378ea656ac6df987209d0eabe1a2d Mon Sep 17 00:00:00 2001 From: Michael Fischer Date: Fri, 13 May 2022 15:09:07 -0700 Subject: [PATCH] Maintain dockershim compatibility symlink after instance reboot --- files/bootstrap.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/files/bootstrap.sh b/files/bootstrap.sh index bac6969be..f7619968c 100644 --- a/files/bootstrap.sh +++ b/files/bootstrap.sh @@ -466,13 +466,17 @@ fi if [[ "$CONTAINER_RUNTIME" = "containerd" ]]; then sudo mkdir -p /etc/containerd sudo mkdir -p /etc/cni/net.d + mkdir -p /etc/systemd/system/containerd.service.d + cat < /etc/systemd/system/containerd.service.d/10-compat-symlink.conf +[Service] +ExecStartPre=/bin/ln -sf /run/containerd/containerd.sock /run/dockershim.sock +EOF sudo sed -i s,SANDBOX_IMAGE,$PAUSE_CONTAINER,g /etc/eks/containerd/containerd-config.toml sudo cp -v /etc/eks/containerd/containerd-config.toml /etc/containerd/config.toml sudo cp -v /etc/eks/containerd/sandbox-image.service /etc/systemd/system/sandbox-image.service sudo cp -v /etc/eks/containerd/kubelet-containerd.service /etc/systemd/system/kubelet.service sudo chown root:root /etc/systemd/system/kubelet.service sudo chown root:root /etc/systemd/system/sandbox-image.service - ln -sf /run/containerd/containerd.sock /run/dockershim.sock systemctl daemon-reload systemctl enable containerd systemctl restart containerd