Prototype: startup install through a shared overlay #10
Labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Blocks
#8 Deploy kuberex on saraksh via Flux HelmRelease
mikluko/kuberex
Reference
mikluko/kuberex#10
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Map: #1
Question
Does a startup install through a shared overlay work on
bulgakov? Shape to prove, in a throwaway pod:hostUsers: false; init and main containers from the same image, each with namespacedCAP_SYS_ADMIN./usr,/etc,/var/lib/dpkgand whatever else apt writes) with upper dirs on an emptyDir, runsapt-get installfor rex (netrc credential from a mounted Secret) and Claude Code, and unmounts.rexwithsetpriv, and runsrex --versionandclaude --version.Unverified going in: user namespaces enabled on this k0s/containerd,
RuntimeDefaultseccomp allowingmountwith the capability, apt working as namespaced root. The answer is the working manifest snippet and entrypoint, or the point it breaks.Answer
Works on
bulgakov. Init container installedrex 0.0.1793420730-g6d0d9aandclaude-code 2.1.309with a realapt-get install; the main container mounted the same overlays, dropped torex(uid 999) with every capability set empty, and ran both.What it takes:
hostUsers: false; root in the pod maps to an unprivileged host range.CAP_SYS_ADMINadded in both containers.Unconfined: containerd's default profile deniesmount. seccompRuntimeDefaultis fine.userxattr: without it, removing a lower directory fails with EIO and dpkg fails with EXDEV./usr,/etc,/var. Re-bind kubelet's/etc/resolv.conf,hosts,hostnameafter mounting over/etc.-o Dir::Etc::netrcparts=/auth.Carry into the image and manifests:
rexuser with a fixed uid/gid in the image before install; postinst reuses it, and/srv/rexownership depends on it.kubectl execlands as pod root with the capability; only processes started through the entrypoint run asrex./srv/rexunder a user namespace (idmapped mount on the host filesystem).Prototype: branch
prototype/overlay-install. Ran inkuberex-taw(namespace via Flux,saraksh/kube1f233f8); prototype objects deleted.