Skip to content

Commit

Permalink
ci: add test for rootful docker
Browse files Browse the repository at this point in the history
This is important to run on multi-node

Signed-off-by: vsoch <[email protected]>
  • Loading branch information
vsoch committed Feb 21, 2025
1 parent b259da8 commit 4eaa091
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ jobs:
include:
- lima_template: template://ubuntu-24.04
container_engine: docker
- lima_template: template://docker-rootful
container_engine: docker-rootful
- lima_template: template://ubuntu-24.04
container_engine: nerdctl
- lima_template: template://centos-stream-9
Expand Down
6 changes: 6 additions & 0 deletions hack/create-cluster-lima.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,12 @@ done

SERVICE_PORTS="PORT_KUBE_APISERVER=${PORT_KUBE_APISERVER} PORT_ETCD=${PORT_ETCD} PORT_FLANNEL=${PORT_FLANNEL} PORT_KUBELET=${PORT_KUBELET}"

# At this point, rootless / rootful Docker is setup
if [[ "$CONTAINER_ENGINE" == "docker-rootful" ]]
then
CONTAINER_ENGINE="docker"
fi

# Launch a Kubernetes node inside a Rootless Docker host
for host in host0 host1; do
${LIMACTL} shell "${host}" ${SERVICE_PORTS} CONTAINER_ENGINE="${CONTAINER_ENGINE}" make -C "${guest_home}/usernetes" up
Expand Down
3 changes: 3 additions & 0 deletions init-host/init-host.root.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@ case "${CONTAINER_ENGINE}" in
fi
systemctl disable --now docker
;;
"docker-rootful")
echo "Preparing to run docker in default rootful mode."
;;
"podman")
if ! command -v podman-compose >/dev/null 2>&1; then
"${script_dir}"/init-host.root.d/install-podman.sh
Expand Down
4 changes: 4 additions & 0 deletions init-host/init-host.rootless.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ case "${CONTAINER_ENGINE}" in
"docker")
dockerd-rootless-setuptool.sh install || (journalctl --user --since "10 min ago"; exit 1)
;;
"docker-rootful")
echo "Skipping rootless install of docker"
CONTAINER_ENGINE="docker"
;;
"nerdctl")
containerd-rootless-setuptool.sh install
containerd-rootless-setuptool.sh install-buildkit-containerd
Expand Down

0 comments on commit 4eaa091

Please sign in to comment.