feat(build): support the Kairos Hadron (musl) base via static runtime#20
Conversation
provider-kubernetes images are now built on the Kairos Hadron minimal/musl immutable OS, via the canonical Kairos build flow (per Itxaka review feedback: the previous approach re-ran a stale kairos-init on an already-Kairos base). - Base: pure upstream ghcr.io/kairos-io/hadron:v0.4.0; kairos-init v0.14.6 runs the canonical two-phase (install, then init) transform as the final step. - Hadron is musl, so the official glibc containerd + kubelet cannot exec: both are built fully static from source (containerd make STATIC=1, kubelet CGO_ENABLED=0). kubeadm/kubectl/crictl/runc are already static and stay the checksum-verified downloads. From-source clones are pinned to commit SHAs (KUBERNETES_COMMIT/CONTAINERD_COMMIT, fail-loud) for download-path integrity parity; static build toolchain patch-pinned (golang:1.26.4). - Single build path: removed the KAIROS_INIT_FINALIZE / STATIC_RUNTIME flags and the dual-base selector stages. - CI + release resolve the per-minor Kubernetes commit SHA (peeled tag) so the from-source build passes across the 1.34/1.35/1.36 matrix; timeouts raised for the from-source compile. - main.go: handle the init.provider.info event kairos-init probes during build (was returning empty JSON -> "unexpected end of JSON input"). - docs/hadron.md + README updated for Hadron-as-base. Validated on libvirt: a control plane converges on Hadron (static binaries active, phase=Converged). The full e2e suite passes on the Hadron node container (no harness change needed). Go gates + actionlint green. Co-Authored-By: Claude <noreply@anthropic.com> Signed-off-by: William Rizzo <william.rizzo@gmail.com>
6b8ecce to
411b0cc
Compare
Itxaka
left a comment
There was a problem hiding this comment.
LGTM
One thing I would change is to try to cache things on order to speed up builds. If nothing changes in the docker file then the cache hits and we don't rebuild. Otherwise, looks good. We may need a workaround for that pkcs11 issue on static builds? Either we build against musl for hadron and other musl systems or we bundle the libs statically as well?
Anyway, for the future.
dito on the cache. |
What
Add support for building a provider-kubernetes image on the Kairos Hadron minimal/musl immutable OS, alongside the default Ubuntu base. Build capability + docs only (no prebuilt Hadron images in the release pipeline; not in CI yet -- both deliberate).
Two build flags cover the differences (Hadron is used unmodified -- no upstream patches to Hadron, kubelet, or containerd):
KAIROS_INIT_FINALIZE=false-- skipkairos-init. Hadron is already a Kairos OS; re-running kairos-init regenerates the kernel/initrd and fails. The needed services (containerd, kubelet) are enabled directly.STATIC_RUNTIME=true-- build containerd (make STATIC=1) and kubelet (CGO_ENABLED=0) from source as static binaries. The official glibc-linked containerd/kubelet cannot exec on musl; kubeadm/kubectl/crictl/runc are already static. A static binary also runs on glibc, so the default Ubuntu build is byte-identical -- buildkit only runs the from-source stages whenSTATIC_RUNTIME=true.Supply chain
The from-source clones are pinned to commit SHAs (
KUBERNETES_COMMIT/CONTAINERD_COMMIT, fail-loud on mismatch) so source integrity matches the checksum discipline of the binary-download path (a git tag is mutable; a commit is content-addressed). Build toolchain patch-pinned (golang:1.26.4).Docs
New
docs/hadron.mdoperator guide: the two flags, build command,:<ver>-hadrontag convention, per-minor commit pinning, verification, and static-binary capability caveats (no dlopen -> no PKCS#11/HSM or.soplugins; glibc NSS bypassed; seccomp/AppArmor/cgroups/runc unaffected). Linked from the docs index and root README.Validation
Hadron Linux, kernel7.1.0-hadron,containerd://2.1.4, both static binaries active, all control-plane pods Running, status + annotations correct.Not in scope (recorded)
Prebuilt Hadron images in the release pipeline; a Hadron CI e2e; digest-pinning the remaining base images (tracked backlog). If Hadron images ever enter the release pipeline they must be brought under the ADR-15 attestation.
🤖 Generated with Claude Code