Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 3 additions & 1 deletion capms/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand All @@ -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

Expand Down
18 changes: 18 additions & 0 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -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}"]
}
2 changes: 1 addition & 1 deletion test/01_start_vm.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading