diff --git a/Earthfile b/Earthfile index 5cc98f6..23188a6 100644 --- a/Earthfile +++ b/Earthfile @@ -86,6 +86,28 @@ ELSE IF [ "$OS_DISTRIBUTION" = "rhel" ] || [ "$OS_DISTRIBUTION" = "sles" ] ARG BASE_IMAGE END +IF [ "$K8S_DISTRIBUTION" = "kubeadm" ] + ARG PROVIDER_BASE=$SPECTRO_PUB_REPO/kairos-io/provider-kubeadm:$KUBEADM_PROVIDER_VERSION +ELSE IF [ "$K8S_DISTRIBUTION" = "kubeadm-fips" ] + ARG PROVIDER_BASE=$SPECTRO_PUB_REPO/kairos-io/provider-kubeadm-fips:$KUBEADM_PROVIDER_VERSION +ELSE IF [ "$K8S_DISTRIBUTION" = "k3s" ] + ARG PROVIDER_BASE=$SPECTRO_PUB_REPO/kairos-io/provider-k3s:$K3S_PROVIDER_VERSION +ELSE IF [ "$K8S_DISTRIBUTION" = "rke2" ] && $FIPS_ENABLED + ARG PROVIDER_BASE=$SPECTRO_PUB_REPO/kairos-io/provider-rke2-fips:$RKE2_PROVIDER_VERSION +ELSE IF [ "$K8S_DISTRIBUTION" = "rke2" ] + ARG PROVIDER_BASE=$SPECTRO_PUB_REPO/kairos-io/provider-rke2:$RKE2_PROVIDER_VERSION +END + +IF [ "$K8S_DISTRIBUTION" = "kubeadm" ] || [ "$K8S_DISTRIBUTION" = "kubeadm-fips" ] + ARG BASE_K8S_VERSION=$K8S_VERSION +ELSE IF [ "$K8S_DISTRIBUTION" = "k3s" ] + ARG K8S_DISTRIBUTION_TAG=$K3S_FLAVOR_TAG + ARG BASE_K8S_VERSION=$K8S_VERSION-$K8S_DISTRIBUTION_TAG +ELSE IF [ "$K8S_DISTRIBUTION" = "rke2" ] + ARG K8S_DISTRIBUTION_TAG=$RKE2_FLAVOR_TAG + ARG BASE_K8S_VERSION=$K8S_VERSION-$K8S_DISTRIBUTION_TAG +END + IF [[ "$BASE_IMAGE" =~ "nvidia-jetson-agx-orin" ]] ARG IS_JETSON=true END @@ -298,16 +320,6 @@ install-k8s: FROM --platform=linux/${ARCH} alpine:3.19 COPY +luet/luet /usr/bin/luet - IF [ "$K8S_DISTRIBUTION" = "kubeadm" ] || [ "$K8S_DISTRIBUTION" = "kubeadm-fips" ] - ARG BASE_K8S_VERSION=$K8S_VERSION - ELSE IF [ "$K8S_DISTRIBUTION" = "k3s" ] - ARG K8S_DISTRIBUTION_TAG=$K3S_FLAVOR_TAG - ARG BASE_K8S_VERSION=$K8S_VERSION-$K8S_DISTRIBUTION_TAG - ELSE IF [ "$K8S_DISTRIBUTION" = "rke2" ] - ARG K8S_DISTRIBUTION_TAG=$RKE2_FLAVOR_TAG - ARG BASE_K8S_VERSION=$K8S_VERSION-$K8S_DISTRIBUTION_TAG - END - WORKDIR /output IF [ "$ARCH" = "arm64" ] @@ -330,6 +342,16 @@ install-k8s: RUN rm -rf /output/var/cache/* SAVE ARTIFACT /output/* +no-kairos: + FROM --platform=linux/${ARCH} +ubuntu-systemd + RUN apt-get update && apt-get install -y rsync + + WORKDIR / + COPY --platform=linux/${ARCH} +install-k8s/ /k8s + COPY +kairos-provider-image/ /providers + + SAVE IMAGE --push $IMAGE_PATH + build-uki-iso: FROM --platform=linux/${ARCH} $OSBUILDER_IMAGE ENV ISO_NAME=${ISO_NAME} @@ -534,19 +556,9 @@ secure-boot-dirs: provider-image: FROM --platform=linux/${ARCH} +base-image # added PROVIDER_K8S_VERSION to fix missing image in ghcr.io/kairos-io/provider-* - ARG IMAGE_REPO - IF [ "$K8S_DISTRIBUTION" = "kubeadm" ] || [ "$K8S_DISTRIBUTION" = "kubeadm-fips" ] - ARG BASE_K8S_VERSION=$K8S_VERSION - IF [ "$OS_DISTRIBUTION" = "ubuntu" ] && [ "$ARCH" = "amd64" ] && [ "$K8S_DISTRIBUTION" = "kubeadm" ] - RUN kernel=$(ls /lib/modules | tail -n1) && if ! ls /usr/src | grep linux-headers-$kernel; then apt-get update && apt-get install -y "linux-headers-${kernel}"; fi - END - ELSE IF [ "$K8S_DISTRIBUTION" = "k3s" ] - ARG K8S_DISTRIBUTION_TAG=$K3S_FLAVOR_TAG - ARG BASE_K8S_VERSION=$K8S_VERSION-$K8S_DISTRIBUTION_TAG - ELSE IF [ "$K8S_DISTRIBUTION" = "rke2" ] - ARG K8S_DISTRIBUTION_TAG=$RKE2_FLAVOR_TAG - ARG BASE_K8S_VERSION=$K8S_VERSION-$K8S_DISTRIBUTION_TAG + IF [ "$OS_DISTRIBUTION" = "ubuntu" ] && [ "$ARCH" = "amd64" ] && [ "$K8S_DISTRIBUTION" = "kubeadm" ] + RUN kernel=$(ls /lib/modules | tail -n1) && if ! ls /usr/src | grep linux-headers-$kernel; then apt-get update && apt-get install -y "linux-headers-${kernel}"; fi END COPY --platform=linux/${ARCH} +kairos-provider-image/ / @@ -598,17 +610,6 @@ stylus-package-image: SAVE ARTIFACT --keep-own ./* kairos-provider-image: - IF [ "$K8S_DISTRIBUTION" = "kubeadm" ] - ARG PROVIDER_BASE=$SPECTRO_PUB_REPO/kairos-io/provider-kubeadm:$KUBEADM_PROVIDER_VERSION - ELSE IF [ "$K8S_DISTRIBUTION" = "kubeadm-fips" ] - ARG PROVIDER_BASE=$SPECTRO_PUB_REPO/kairos-io/provider-kubeadm-fips:$KUBEADM_PROVIDER_VERSION - ELSE IF [ "$K8S_DISTRIBUTION" = "k3s" ] - ARG PROVIDER_BASE=$SPECTRO_PUB_REPO/kairos-io/provider-k3s:$K3S_PROVIDER_VERSION - ELSE IF [ "$K8S_DISTRIBUTION" = "rke2" ] && $FIPS_ENABLED - ARG PROVIDER_BASE=$SPECTRO_PUB_REPO/kairos-io/provider-rke2-fips:$RKE2_PROVIDER_VERSION - ELSE IF [ "$K8S_DISTRIBUTION" = "rke2" ] - ARG PROVIDER_BASE=$SPECTRO_PUB_REPO/kairos-io/provider-rke2:$RKE2_PROVIDER_VERSION - END FROM --platform=linux/${ARCH} $PROVIDER_BASE SAVE ARTIFACT ./* @@ -752,7 +753,7 @@ base-image: journalctl --vacuum-size=1K && \ rm -rf /etc/machine-id && \ rm -rf /var/lib/dbus/machine-id - RUN touch /etc/machine-id && \ + RUN touch /etc/machine-id && \ chmod 444 /etc/machine-id RUN rm /tmp/* -rf