Skip to content

Commit

Permalink
add support for 1.27 and 1.28 k8s bundles
Browse files Browse the repository at this point in the history
  • Loading branch information
zugwan committed May 2, 2024
1 parent 51dc772 commit c91d452
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 18 deletions.
9 changes: 7 additions & 2 deletions installer/bundle_builder/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,12 @@
# // Build and store a BYOH bundle
# docker run --rm -v <INGREDIENTS_HOST_ABS_PATH>:/ingredients -v <BUNDLE_OUTPUT_ABS_PATH>:/bundle --env <THIS_IMAGE>

FROM k14s/image
# https://github.com/carvel-dev/docker-image/blob/develop/Dockerfile
FROM ubuntu
# perl is needed for shasum
RUN apt-get -y update && apt-get install -y wget perl ca-certificates && update-ca-certificates && rm -rf /var/lib/apt/lists/*
RUN bash -c "set -eo pipefail; wget -O- https://carvel.dev/install.sh | bash"
RUN ytt version && kapp version && kbld version && kwt version && imgpkg version && vendir version

# If set to 1 bundle is built and available as bundle/bundle.tar
# If set to 0 bundle is build and pushed to repo
Expand All @@ -32,4 +37,4 @@ RUN mkdir /ingredients && mkdir /bundle
ENV PATH="/bundle-builder:${PATH}"

WORKDIR /tmp/bundle
ENTRYPOINT ["build-push-bundle.sh", "/ingredients", "/config"]
ENTRYPOINT ["build-push-bundle.sh", "/ingredients", "/config", "rpm"]
6 changes: 3 additions & 3 deletions installer/bundle_builder/ingredients/rpm/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,12 @@
# 2. Run the image
#

ARG BASE_IMAGE=rockylinux:8.7
ARG BASE_IMAGE=rockylinux:8
FROM $BASE_IMAGE as build

# Override to download other version
ENV CONTAINERD_VERSION=1.6.18
ENV KUBERNETES_VERSION=1.25.11-0
ENV CONTAINERD_VERSION=1.6.31
ENV KUBERNETES_VERSION=1.28
ENV ARCH=x86_64

RUN dnf -y install sudo
Expand Down
20 changes: 7 additions & 13 deletions installer/bundle_builder/ingredients/rpm/download.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,21 @@

set -e

echo Update the apt package index and install packages needed to use the Kubernetes apt repository
sudo dnf install -y apt-transport-https ca-certificates curl
sudo dnf install -y 'dnf-command(download)'

echo Download containerd
curl -LOJR https://github.com/containerd/containerd/releases/download/v${CONTAINERD_VERSION}/cri-containerd-cni-${CONTAINERD_VERSION}-linux-amd64.tar.gz

echo Download the Google Cloud public signing key
sudo curl -fsSLo /usr/share/keyrings/kubernetes-archive-keyring.gpg https://dl.k8s.io/apt/doc/apt-key.gpg

echo Add the Kubernetes apt repository
sudo cat <<EOF > /etc/yum.repos.d/kubernetes.repo
echo Add the Kubernetes repository
cat <<EOF | sudo tee /etc/yum.repos.d/kubernetes.repo
[kubernetes]
name=Kubernetes
baseurl=https://packages.cloud.google.com/yum/repos/kubernetes-el7-x86_64
baseurl=https://pkgs.k8s.io/core:/stable:/v${KUBERNETES_VERSION}/rpm/
enabled=1
gpgcheck=1
repo_gpgcheck=1
gpgkey=https://packages.cloud.google.com/yum/doc/yum-key.gpg https://packages.cloud.google.com/yum/doc/rpm-package-key.gpg
gpgkey=https://pkgs.k8s.io/core:/stable:/v${KUBERNETES_VERSION}/rpm/repodata/repomd.xml.key
exclude=kubelet kubeadm kubectl cri-tools kubernetes-cni
EOF

echo Update dnf package index, install kubelet, kubeadm and kubectl
sudo dnf download {kubelet,kubeadm,kubectl}-$KUBERNETES_VERSION --arch $ARCH
sudo dnf download kubernetes-cni-1.1.1-0 --arch $ARCH
sudo dnf download cri-tools-1.25.0-0 --arch $ARCH
dnf download kubelet kubeadm kubectl cri-tools kubernetes-cni --disableexcludes=kubernetes --arch ${ARCH}

0 comments on commit c91d452

Please sign in to comment.