run.sh does not execute automatically, preventing airgap setup from completing #3422
Replies: 4 comments 7 replies
-
I don't think we have a stages.install. we have a stage called kairos-install.pre and kairos-install.post Maybe it's that? |
Beta Was this translation helpful? Give feedback.
-
In the
To better understand the ordering, The silence you hear from the |
Beta Was this translation helpful? Give feedback.
-
k3s uses the github.com/rancher/warfie project to load images into the container runtime. Supported filename extensions are Reference |
Beta Was this translation helpful? Give feedback.
-
Just for reference, I'm trying a full offline install of k0s, here is my current cloud-config and Dockerfile. The node installs, boots, k0s starts, kubelet is posting node ready, and kube-proxy pod is running. :) It required quite some more digging than I had anticipated, but it's a good learning journey. Although maybe both the k0s and k3s instructions can do with a bit of an update. (Maybe a proper reference for the k0s and k3s sections in cloud-config would help!). config.tpl.yaml (I envsubst to config.yaml before using with AuroraBoot)#cloud-config
hostname: node-1
users:
- name: kairos
passwd: ${USERPASS}
groups:
- admin
# ssh-authorized-keys:
# - github:${GITHUB_USER}
install:
auto: true
reboot: true
device: ${KAIROS_DEVICE}
no-format: false
force: true
stages:
initramfs:
- files:
- path: /etc/systemd/network/01-dummy.netdev
permissions: 0644
content: |
[NetDev]
Name=dummy0
Kind=dummy
- path: /etc/systemd/network/02-dummy.network
permissions: 0644
content: |
[Match]
Name=dummy0
[Network]
Address=${IP}
- path: /etc/k0s/k0s.yaml
permissions: 0644
content: |
apiVersion: k0s.k0sproject.io/v1beta1
kind: ClusterConfig
metadata:
name: k0s
spec:
api:
address: ${IP}
- path: /etc/systemd/system/k0scontroller.service.d/override.conf
permissions: 0644
content: |
[Service]
ExecStart=
ExecStart=/usr/bin/k0s controller --enable-worker --no-taints
boot:
- name: "Start k0s"
if: '[ -e "/sbin/systemctl" ] || [ -e "/usr/bin/systemctl" ] || [ -e "/usr/sbin/systemctl" ] || [ -e "/usr/bin/systemctl" ]'
commands:
- systemctl start k0scontroller
p2p:
disable_dht: true # discover nodes only in the local network
network_token: ${EDGEVPN_TOKEN}
auto:
enable: true
ha:
enable: true
master_nodes: 2 # first node is implied
k0s:
enabled: true DockerfileARG BASE_IMAGE=ubuntu:24.10
ARG VARIANT=standard
ARG MODEL=generic
ARG TRUSTED_BOOT=false
ARG KUBERNETES_DISTRO=k0s
ARG KUBERNETES_VERSION=v1.33.1
ARG KUBEVIRT_VERSION=v1.6.0-beta.0
ARG FRAMEWORK_VERSION=v2.22.0
ARG VERSION=0.0.1
FROM quay.io/kairos/kairos-init:latest AS kairos-init
FROM alpine AS alpine
ARG KUBERNETES_VERSION
ARG KUBEVIRT_VERSION
RUN wget https://github.com/k0sproject/k0s/releases/download/${KUBERNETES_VERSION}%2Bk0s.0/k0s-airgap-bundle-${KUBERNETES_VERSION}+k0s.0-amd64
RUN wget https://github.com/kubevirt/kubevirt/releases/download/${KUBEVIRT_VERSION}/kubevirt-operator.yaml
FROM ${BASE_IMAGE} AS base-kairos
ARG KUBERNETES_VERSION
ARG FRAMEWORK_VERSION
ARG MODEL
ARG VARIANT
ARG TRUSTED_BOOT
ARG KUBERNETES_DISTRO
ARG VERSION
COPY --from=kairos-init /kairos-init /kairos-init
RUN mkdir -p /var/lib/k0s/images /var/lib/k0s/manifests
COPY --from=alpine /k0s-airgap-bundle-${KUBERNETES_VERSION}+k0s.0-amd64 /var/lib/k0s/images/image-bundle.tar
COPY --from=alpine /kubevirt-operator.yaml /var/lib/k0s/manifests/kubevirt-operator.yaml
RUN /kairos-init -f "${FRAMEWORK_VERSION}" -l debug -s install -m "${MODEL}" -v "${VARIANT}" -t "${TRUSTED_BOOT}" -k "${KUBERNETES_DISTRO}" --k8sversion "${KUBERNETES_VERSION}+k0s.0" --version "${VERSION}"
RUN /kairos-init -f "${FRAMEWORK_VERSION}" -l debug -s init -m "${MODEL}" -v "${VARIANT}" -t "${TRUSTED_BOOT}" -k "${KUBERNETES_DISTRO}" --k8sversion "${KUBERNETES_VERSION}+k0s.0" --version "${VERSION}"
RUN /kairos-init -f "${FRAMEWORK_VERSION}" -l debug --validate -m "${MODEL}" -v "${VARIANT}" -t "${TRUSTED_BOOT}" -k "${KUBERNETES_DISTRO}" --k8sversion "${KUBERNETES_VERSION}+k0s.0" --version "${VERSION}"
RUN rm /kairos-init |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Hey community :)
I'm building an airgap ISO using AuroraBoot and a valid OCI
bundle.tar
that contains:/assets/k3s-airgap-images-amd64.tar.gz
/assets/run.sh
(script to copy the image into/var/lib/rancher/k3s/agent/images/
)config.yaml
with stages.bootI also pass an external
config.yaml
to AuroraBoot, which is identical to the one inside the bundle (same content), but with different intention:install:
andstages.install
)stages.boot
that will run after first bootWhat works:
stages.boot
from the bundle runs and writes to/usr/local/.state/kairos-stage.log.
What doesn’t work:
run.sh
(inside the bundle) is never executed.stages.install
from the external config.yaml is silently skipped, even thoughinstall: works
.I unpacked the OCI with umoci in my local and confirmed everything is in place. It seems Kairos prioritizes the config from the bundle for stages and ignores
stages.install
from the external config, even though it processes theinstall:
block without executingrun.sh
but considering the config because ofstages.boot
.Questions:
What’s the clean, official way to execute the
run.sh
from the bundle to move the k3s image to a persistent path?Why is stages.install skipped with no warning?
Why doesn’t the airgap example specify this clearly about how
run.sh
is executed?Thanks!
Beta Was this translation helpful? Give feedback.
All reactions