From ffe0e8680c3b640c6f7858403af42119c2c028e5 Mon Sep 17 00:00:00 2001 From: Cesar Talledo Date: Mon, 14 Aug 2023 13:48:37 -0700 Subject: [PATCH] sysbox-deploy-k8s: add support for k8s v1.27 Signed-off-by: Cesar Talledo --- k8s/Dockerfile.sysbox-ce | 19 +++++++------------ k8s/Makefile | 8 +++++--- k8s/scripts/crio-build.sh | 2 +- k8s/scripts/crio-installer.sh | 3 +++ k8s/scripts/sysbox-deploy-k8s.sh | 9 +++++---- 5 files changed, 21 insertions(+), 20 deletions(-) diff --git a/k8s/Dockerfile.sysbox-ce b/k8s/Dockerfile.sysbox-ce index f3ac0ef..77dac43 100644 --- a/k8s/Dockerfile.sysbox-ce +++ b/k8s/Dockerfile.sysbox-ce @@ -1,5 +1,5 @@ # -# Copyright 2019-2022 Nestybox, Inc. +# Copyright 2019-2023 Nestybox, Inc. # # @@ -21,11 +21,10 @@ ARG sys_arch ENV SYS_ARCH=${sys_arch} ARG DEST=/opt/sysbox ARG CRICTL_VERSION="v1.24.2" -ARG CRIO_V1_22_TAR="cri-o.${SYS_ARCH}.v1.22.0.tar.gz" -ARG CRIO_V1_23_TAR="cri-o.${SYS_ARCH}.v1.23.0.tar.gz" ARG CRIO_V1_24_TAR="cri-o.${SYS_ARCH}.v1.24.0.tar.gz" ARG CRIO_V1_25_TAR="cri-o.${SYS_ARCH}.v1.25.0.tar.gz" ARG CRIO_V1_26_TAR="cri-o.${SYS_ARCH}.v1.26.0.tar.gz" +ARG CRIO_V1_27_TAR="cri-o.${SYS_ARCH}.v1.27.0.tar.gz" RUN yum install -y curl wget git bc which @@ -72,14 +71,6 @@ COPY scripts/sysbox-removal-helper.sh /opt/sysbox/scripts/sysbox-removal-helper. # Load CRI-O installation artifacts # -RUN wget https://storage.googleapis.com/cri-o/artifacts/${CRIO_V1_22_TAR} -O cri-o.${SYS_ARCH}.tar.gz \ - && mkdir -p /opt/crio-deploy/bin/v1.22 \ - && mv cri-o.${SYS_ARCH}.tar.gz /opt/crio-deploy/bin/v1.22/. - -RUN wget https://storage.googleapis.com/cri-o/artifacts/${CRIO_V1_23_TAR} -O cri-o.${SYS_ARCH}.tar.gz \ - && mkdir -p /opt/crio-deploy/bin/v1.23 \ - && mv cri-o.${SYS_ARCH}.tar.gz /opt/crio-deploy/bin/v1.23/. - RUN wget https://storage.googleapis.com/cri-o/artifacts/${CRIO_V1_24_TAR} -O cri-o.${SYS_ARCH}.tar.gz \ && mkdir -p /opt/crio-deploy/bin/v1.24 \ && mv cri-o.${SYS_ARCH}.tar.gz /opt/crio-deploy/bin/v1.24/. @@ -92,6 +83,10 @@ RUN wget https://storage.googleapis.com/cri-o/artifacts/${CRIO_V1_26_TAR} -O cri && mkdir -p /opt/crio-deploy/bin/v1.26 \ && mv cri-o.${SYS_ARCH}.tar.gz /opt/crio-deploy/bin/v1.26/. +RUN wget https://storage.googleapis.com/cri-o/artifacts/${CRIO_V1_27_TAR} -O cri-o.${SYS_ARCH}.tar.gz \ + && mkdir -p /opt/crio-deploy/bin/v1.27 \ + && mv cri-o.${SYS_ARCH}.tar.gz /opt/crio-deploy/bin/v1.27/. + COPY systemd/crio-installer.service /opt/crio-deploy/systemd/crio-installer.service COPY systemd/crio-removal.service /opt/crio-deploy/systemd/crio-removal.service COPY scripts/crio-extractor.sh /opt/crio-deploy/scripts/crio-extractor.sh @@ -117,7 +112,7 @@ COPY config/etc_containers_registries.d_default.yaml /opt/crio-deploy/config/etc # Load CRI-O patched binaries (to generate correct user-ns mappings) # -COPY bin/crio/v1.23/crio /opt/crio-deploy/bin/v1.23/crio-patched COPY bin/crio/v1.24/crio /opt/crio-deploy/bin/v1.24/crio-patched COPY bin/crio/v1.25/crio /opt/crio-deploy/bin/v1.25/crio-patched COPY bin/crio/v1.26/crio /opt/crio-deploy/bin/v1.26/crio-patched +COPY bin/crio/v1.27/crio /opt/crio-deploy/bin/v1.27/crio-patched diff --git a/k8s/Makefile b/k8s/Makefile index aa3a97c..2fa3d18 100644 --- a/k8s/Makefile +++ b/k8s/Makefile @@ -161,11 +161,13 @@ crio-build-container: # # bin # ├── crio -# │   └── v1.21 +# │   └── v1.24 # │   └── crio -# │   └── v1.22 +# │   └── v1.25 # │   └── crio -# │   ├── v1.23 +# │   ├── v1.26 +# │   │   └── crio +# │   ├── v1.27 # │   │   └── crio # ├── sysbox-ce # │   ├── ubuntu-bionic diff --git a/k8s/scripts/crio-build.sh b/k8s/scripts/crio-build.sh index 274036c..efe2387 100755 --- a/k8s/scripts/crio-build.sh +++ b/k8s/scripts/crio-build.sh @@ -9,7 +9,7 @@ # Usage: docker run -v $(shell pwd)/bin:/mnt/results crio-bld # -declare -a CRIO_VERSIONS=(v1.23 v1.24 v1.25 v1.26) +declare -a CRIO_VERSIONS=(v1.24 v1.25 v1.26 v1.27) for ver in ${CRIO_VERSIONS[@]}; do printf "\n*** Building CRI-O ${ver} ... ***\n\n" diff --git a/k8s/scripts/crio-installer.sh b/k8s/scripts/crio-installer.sh index 49a69af..925af00 100755 --- a/k8s/scripts/crio-installer.sh +++ b/k8s/scripts/crio-installer.sh @@ -89,6 +89,9 @@ function do_install_crio() { sed -i "/Type=notify/a Environment=PATH=${path}:/sbin:/bin:/usr/sbin:/usr/bin" /etc/systemd/system/crio.service sed -i "s@/usr/local/bin/crio@${path}/crio@" /etc/systemd/system/crio.service fi + + # Create directories expected by CRI-O + mkdir -p /var/lib/crio } function install_crio() { diff --git a/k8s/scripts/sysbox-deploy-k8s.sh b/k8s/scripts/sysbox-deploy-k8s.sh index 523b111..2c196b4 100755 --- a/k8s/scripts/sysbox-deploy-k8s.sh +++ b/k8s/scripts/sysbox-deploy-k8s.sh @@ -744,17 +744,18 @@ function is_supported_k8s_version() { local ver=$k8s_version - if [[ "$ver" == "v1.23" ]] || - [[ "$ver" == "v1.24" ]] || + if [[ "$ver" == "v1.24" ]] || [[ "$ver" == "v1.25" ]] || - [[ "$ver" == "v1.26" ]]; then + [[ "$ver" == "v1.26" ]] || + [[ "$ver" == "v1.27" ]]; then return fi if [[ "$ver" == "v1.19" ]] || [[ "$ver" == "v1.20" ]] || [[ "$ver" == "v1.21" ]] || - [[ "$ver" == "v1.22" ]]; then + [[ "$ver" == "v1.22" ]] || + [[ "$ver" == "v1.23" ]]; then echo "Unsupported kubernetes version: $ver (EOL release)." fi