diff --git a/.github/workflows/docker.yaml b/.github/workflows/docker.yaml index 52cb22fa..ea485c74 100644 --- a/.github/workflows/docker.yaml +++ b/.github/workflows/docker.yaml @@ -203,6 +203,40 @@ jobs: SEMVER_PATCH: ${{ env.SEMVER_PATCH }} if: ${{ matrix.os.name == 'ubuntu' }} + - name: Prepare build environment + shell: bash + run: ./prepare.sh capms-ubuntu-kamaji + env: + SEMVER_MAJOR_MINOR: 1.33.5 + if: ${{ matrix.os.name == 'ubuntu' }} + + - name: Build docker image for capms kamaji flavor + uses: docker/bake-action@v6 + with: + source: . + files: ./docker-bake.hcl + targets: ubuntu-capms-kamaji + no-cache: true + set: _common.output+=type=registry + env: + KUBE_VERSION: 1.33.5 + KUBE_APT_BRANCH: v1.33 + OS_NAME: capms-ubuntu + SEMVER_MAJOR_MINOR: 1.33.5 + SEMVER_PATCH: ${{ env.SEMVER_PATCH }} + if: ${{ matrix.os.name == 'ubuntu' }} + + - name: Test and export docker image for capms kamaji + run: | + ./test.sh + ./export.sh + env: + IMG_PKG_COMMAND: dpkg -l + OS_NAME: capms-ubuntu + SEMVER_MAJOR_MINOR: 1.33.5 + SEMVER_PATCH: ${{ env.SEMVER_PATCH }} + + if: ${{ matrix.os.name == 'ubuntu' }} - name: Prepare build environment shell: bash run: ./prepare.sh debian-nvidia diff --git a/Makefile b/Makefile index f809f0c9..cbc02adb 100644 --- a/Makefile +++ b/Makefile @@ -73,6 +73,14 @@ capms: test ubuntu docker buildx bake --no-cache ubuntu-capms OS_NAME=capms-ubuntu OUTPUT_FOLDER="" SEMVER_MAJOR_MINOR=1.32.9 ./test.sh +.PHONY: capms-kamaji +capms-kamaji: test ubuntu + KUBE_VERSION=1.33.5 \ + KUBE_APT_BRANCH=v1.33 \ + SEMVER_MAJOR_MINOR=1.33.5 \ + docker buildx bake --no-cache ubuntu-capms + OS_NAME=capms-ubuntu OUTPUT_FOLDER="" SEMVER_MAJOR_MINOR=1.33.5 ./test.sh + .PHONY: firewall firewall: test binary mkdir -p "images/firewall/3.0-ubuntu" diff --git a/capms/Dockerfile b/capms/Dockerfile index 94d6e992..a6d5b4d8 100644 --- a/capms/Dockerfile +++ b/capms/Dockerfile @@ -8,6 +8,8 @@ ENV DEBCONF_NONINTERACTIVE_SEEN="true" \ DEBIAN_FRONTEND="noninteractive" COPY --from=ctx . / +RUN \[ "${KUBE_VIP_VERSION}" = "" \] \ + && rm -f /usr/local/bin/kubeadm-prepare-kubevip.sh /etc/systemd/system/kubeadm.service.d/kubevip-prepare.conf RUN curl -fsSL https://pkgs.k8s.io/core:/stable:/${KUBE_APT_BRANCH}/deb/Release.key | gpg --dearmor -o /etc/apt/keyrings/kubernetes-apt-keyring.gpg \ && echo "deb [signed-by=/etc/apt/keyrings/kubernetes-apt-keyring.gpg] https://pkgs.k8s.io/core:/stable:/${KUBE_APT_BRANCH}/deb/ /" > /etc/apt/sources.list.d/kubernetes.list \ @@ -30,7 +32,7 @@ RUN tar -xzf /download/gocontainerregistry.tar \ && bash -c 'for img in $(kubeadm config images list --kubernetes-version ${KUBE_VERSION}); do \ /crane pull --format tarball $img /kubeadm-images/$(basename $img).tar; \ done' \ - && /crane pull --format tarball ghcr.io/kube-vip/kube-vip:${KUBE_VIP_VERSION} /kubeadm-images/kube-vip.tar + && [ "${KUBE_VIP_VERSION}" != "" ] && /crane pull --format tarball ghcr.io/kube-vip/kube-vip:${KUBE_VIP_VERSION} /kubeadm-images/kube-vip.tar FROM kubeadm-base AS kubeadm-runtime diff --git a/docker-bake.hcl b/docker-bake.hcl index d84192fa..4c560be3 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -133,3 +133,21 @@ target "ubuntu-capms" { } tags = ["ghcr.io/metal-stack/capms-ubuntu:${SEMVER_MAJOR_MINOR}${SEMVER_PATCH}"] } + +target "ubuntu-capms-kamaji" { + inherits = ["_common"] + dockerfile = "./capms/Dockerfile" + contexts = { + baseapp = "target:ubuntu" + ctx = "./capms/context" + } + args = { + KUBE_APT_BRANCH = "${KUBE_APT_BRANCH}" + KUBE_VERSION = "${KUBE_VERSION}" + # KUBE_VIP_VERSION = "v0.8.10" + + CRANE_CHECKSUM = "sha256:36c67a932f489b3f2724b64af90b599a8ef2aa7b004872597373c0ad694dc059" + CRANE_RELEASE = "https://github.com/google/go-containerregistry/releases/download/v0.20.3/go-containerregistry_Linux_x86_64.tar.gz" + } + tags = ["ghcr.io/metal-stack/capms-ubuntu:${SEMVER_MAJOR_MINOR}${SEMVER_PATCH}"] +} diff --git a/test/01_start_vm.sh b/test/01_start_vm.sh index 83d6a84e..07128cd8 100755 --- a/test/01_start_vm.sh +++ b/test/01_start_vm.sh @@ -14,7 +14,7 @@ ip link set tap0 up || true ip link set tap0 master vm-br0 || true # kernels shipped with ubuntu based images allow for direct kernel boot without passing initrd to cloud-hypervisor -if [[ "${OS_NAME}" == "ubuntu" || "${OS_NAME}" == "capms-ubuntu" ]]; then +if [[ "${OS_NAME}" == "ubuntu" || "${OS_NAME}" == "capms-ubuntu" || "${OS_NAME}" == "capms-ubuntu-kamaji" ]]; then INITRAMFS="" KERNEL="os-kernel" elif [[ "${OS_NAME}" == *"firewall" ]]; then