Skip to content

Commit 3a20633

Browse files
authored
Merge pull request #146 from stackhpc/yoga_support_earlier_1_27
Fix containerd runtime for releases older than 1.27
2 parents f894de1 + d589f0f commit 3a20633

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-master.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,14 @@ KUBELET_ARGS="${KUBELET_ARGS} --client-ca-file=${CERT_DIR}/ca.crt --tls-cert-fil
496496

497497
# specified cgroup driver
498498
KUBELET_ARGS="${KUBELET_ARGS} --cgroup-driver=${CGROUP_DRIVER}"
499+
499500
if [ ${CONTAINER_RUNTIME} = "containerd" ] ; then
501+
# check kubelet version, 1.27.0 dropped docker shim and --container-runtime command line option
502+
KUBELET_VERSION=$(podman run ${CONTAINER_INFRA_PREFIX:-${HYPERKUBE_PREFIX}}hyperkube:${KUBE_TAG} kubelet --version | awk '{print $2}')
503+
CONTAINER_RUNTIME_REMOTE_DROPPED="v1.27.0"
504+
if [[ "${CONTAINER_RUNTIME_REMOTE_DROPPED}" != $(echo -e "${CONTAINER_RUNTIME_REMOTE_DROPPED}\n${KUBELET_VERSION}" | sort -V | head -n1) && "${KUBELET_VERSION}" != "devel" ]]; then
505+
KUBELET_ARGS="${KUBELET_ARGS} --container-runtime=remote"
506+
fi
500507
KUBELET_ARGS="${KUBELET_ARGS} --runtime-cgroups=/system.slice/containerd.service"
501508
KUBELET_ARGS="${KUBELET_ARGS} --runtime-request-timeout=15m"
502509
KUBELET_ARGS="${KUBELET_ARGS} --container-runtime-endpoint=unix:///run/containerd/containerd.sock"

magnum/drivers/common/templates/kubernetes/fragments/configure-kubernetes-minion.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,12 @@ KUBELET_ARGS="${KUBELET_ARGS} --client-ca-file=${CERT_DIR}/ca.crt --tls-cert-fil
274274
# specified cgroup driver
275275
KUBELET_ARGS="${KUBELET_ARGS} --cgroup-driver=${CGROUP_DRIVER}"
276276
if [ ${CONTAINER_RUNTIME} = "containerd" ] ; then
277+
# check kubelet version, 1.27.0 dropped docker shim and --container-runtime command line option
278+
KUBELET_VERSION=$(podman run ${CONTAINER_INFRA_PREFIX:-${HYPERKUBE_PREFIX}}hyperkube:${KUBE_TAG} kubelet --version | awk '{print $2}')
279+
CONTAINER_RUNTIME_REMOTE_DROPPED="v1.27.0"
280+
if [[ "${CONTAINER_RUNTIME_REMOTE_DROPPED}" != $(echo -e "${CONTAINER_RUNTIME_REMOTE_DROPPED}\n${KUBELET_VERSION}" | sort -V | head -n1) && "${KUBELET_VERSION}" != "devel" ]]; then
281+
KUBELET_ARGS="${KUBELET_ARGS} --container-runtime=remote"
282+
fi
277283
KUBELET_ARGS="${KUBELET_ARGS} --runtime-cgroups=/system.slice/containerd.service"
278284
KUBELET_ARGS="${KUBELET_ARGS} --runtime-request-timeout=15m"
279285
KUBELET_ARGS="${KUBELET_ARGS} --container-runtime-endpoint=unix:///run/containerd/containerd.sock"

0 commit comments

Comments
 (0)