Skip to content

Commit

Permalink
sysbox-deploy-k8s: add support for k8s v1.27
Browse files Browse the repository at this point in the history
Signed-off-by: Cesar Talledo <cesar.talledo@docker.com>
  • Loading branch information
ctalledo committed Aug 15, 2023
1 parent b560194 commit ffe0e86
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
19 changes: 7 additions & 12 deletions k8s/Dockerfile.sysbox-ce
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Copyright 2019-2022 Nestybox, Inc.
# Copyright 2019-2023 Nestybox, Inc.
#

#
Expand All @@ -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

Expand Down Expand Up @@ -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/.
Expand All @@ -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
Expand All @@ -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
8 changes: 5 additions & 3 deletions k8s/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion k8s/scripts/crio-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
3 changes: 3 additions & 0 deletions k8s/scripts/crio-installer.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down
9 changes: 5 additions & 4 deletions k8s/scripts/sysbox-deploy-k8s.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit ffe0e86

Please sign in to comment.