Skip to content

Commit

Permalink
Usernetes Gen2: depends on Rootless Docker on hosts
Browse files Browse the repository at this point in the history
Fix issue 286

Usernetes (Gen2) deploys a Kubernetes cluster on [Rootless Docker hosts](https://rootlesscontaine.rs/getting-started/docker/).

> **Note**
>
> Usernetes (Gen2) has *significantly* diverged from the original Usernetes (Gen1),
> which did not rely on Rootless Docker hosts.
>
> See the [`gen1`](https://github.com/rootless-containers/usernetes/tree/gen1) branch for
> the original Usernetes (Gen1).

Usernetes (Gen2) is similar to [Rootless `kind`](https://kind.sigs.k8s.io/docs/user/rootless/)
and [Rootless minikube](https://minikube.sigs.k8s.io/docs/drivers/docker/),
but Usernetes (Gen 2) supports creating a cluster with multiple hosts.

See `make help` and `README.md` for the usage.

Signed-off-by: Akihiro Suda <[email protected]>
  • Loading branch information
AkihiroSuda committed Sep 5, 2023
1 parent 745a35c commit 8f42c76
Show file tree
Hide file tree
Showing 70 changed files with 662 additions and 3,783 deletions.
46 changes: 0 additions & 46 deletions .cirrus.yml

This file was deleted.

1 change: 0 additions & 1 deletion .dockerignore

This file was deleted.

2 changes: 2 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/kubeconfig
/join-command
39 changes: 0 additions & 39 deletions .github/workflows/ghcr.yaml

This file was deleted.

65 changes: 50 additions & 15 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,25 +1,60 @@
---
name: Main
on: [push, pull_request]
env:
DOCKER_BUILDKIT: 1
KUBECONFIG: ./kubeconfig
jobs:
docker:
name: "Docker"
single-node:
name: "Single node"
runs-on: ubuntu-22.04
timeout-minutes: 40
steps:
- name: "System info"
run: sh -xec "uname -a; docker info; cat /proc/cpuinfo; df -h"
- uses: actions/checkout@v3
- name: "Make"
run: make image
- name: "Clean up (To avoid `node.kubernetes.io/disk-pressure` taint)"
- name: Set up cgroup v2 delegation
run: |
make clean
docker builder prune -a -f
- name: "Smoke test (containerd)"
run: ./hack/smoketest-docker.sh u7s-test-containerd ghcr.io/rootless-containers/usernetes --cri=containerd
- name: "Smoke test (CRI-O)"
run: ./hack/smoketest-docker.sh u7s-test-crio ghcr.io/rootless-containers/usernetes --cri=crio
- name: "Smoke test (multi-node cluster with Flannel)"
run: ./hack/smoketest-docker-compose.sh
sudo mkdir -p /etc/systemd/system/[email protected]
cat <<EOF | sudo tee /etc/systemd/system/[email protected]/delegate.conf
[Service]
Delegate=cpu cpuset io memory pids
EOF
sudo systemctl daemon-reload
- name: Set up Rootless Docker
run: |
set -eux -o pipefail
sudo apt-get remove moby-engine-*
curl https://get.docker.com | sudo sh
sudo systemctl disable --now docker.socket docker.service
sudo rm -rf /var/run/docker*
dockerd-rootless-setuptool.sh install
docker info
- run: make up
- run: sleep 5
- run: make kubeadm-init
- run: make install-flannel
- run: make kubeconfig
- run: kubectl taint nodes --all node-role.kubernetes.io/control-plane-
- run: ./hack/test-smoke.sh
- name: "Test data persistency after restarting the node"
run: |
make down
make up
sleep 30
./hack/test-smoke.sh
multi-node:
name: "Multi node (emulated using LXD)"
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
- run: sudo modprobe vxlan
- uses: actions/checkout@v3
- uses: canonical/[email protected]
- run: ./hack/create-cluster-lxd.sh
- run: kubectl taint nodes --all node-role.kubernetes.io/control-plane- || true
- run: ./hack/test-smoke.sh
- name: "Test data persistency after restarting the node"
run: |
lxc restart host0 host1
sleep 30
./hack/test-smoke.sh
46 changes: 0 additions & 46 deletions .github/workflows/release.yaml

This file was deleted.

8 changes: 2 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,2 @@
bin/
_artifact/
.vagrant/
*.pem
*.csr
*.kubeconfig
/kubeconfig
/join-command
Loading

0 comments on commit 8f42c76

Please sign in to comment.