Skip to content

Commit

Permalink
add trying usernetes
Browse files Browse the repository at this point in the history
Signed-off-by: vsoch <vsoch@users.noreply.github.com>
  • Loading branch information
vsoch committed May 27, 2023
1 parent eb2d470 commit 2070bc4
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,23 +50,23 @@ substitutions="_ZONE=${zone}"
if [ "X${manager_machine_type}" != "X" ]; then
source_image=$(gcloud compute images list --filter="name ~ rocky-linux-${rocky_linux_version}-optimized-gcp-v" --format="value(name)")
m4 --define=ROCKY_VERSION=${rocky_linux_version} flux-manager-builder-startup-script.m4 > flux-manager-builder-startup-script.sh
gcloud builds submit --config=managerbuild.yaml --substitutions=_ZONE=${zone},_MACHINE_TYPE=${manager_machine_type},_SOURCE_IMAGE=${source_image},_SUBNETWORK=${subnetwork} .
gcloud builds submit --config=managerbuild.yaml --substitutions=_ZONE=${zone},_MACHINE_TYPE=${manager_machine_type},_SOURCE_IMAGE=${source_image},_SUBNETWORK=${subnetwork} --verbosity=debug .
fi

if [ "X${login_machine_type}" != "X" ]; then
source_image=$(gcloud compute images list --filter="name ~ rocky-linux-${rocky_linux_version}-optimized-gcp-v" --format="value(name)")
m4 --define=ROCKY_VERSION=${rocky_linux_version} flux-login-builder-startup-script.m4 > flux-login-builder-startup-script.sh
gcloud builds submit --config=loginbuild.yaml --substitutions=_ZONE=${zone},_MACHINE_ARCHITECTURE="x86-64",_MACHINE_TYPE=${login_machine_type},_SOURCE_IMAGE=${source_image},_SUBNETWORK=${subnetwork} .
gcloud builds submit --config=loginbuild.yaml --substitutions=_ZONE=${zone},_MACHINE_ARCHITECTURE="x86-64",_MACHINE_TYPE=${login_machine_type},_SOURCE_IMAGE=${source_image},_SUBNETWORK=${subnetwork} --verbosity=debug .
fi

if [ "X${arm_machine_type}" != "X" ]; then
source_image=$(gcloud compute images list --filter="name ~ rocky-linux-${rocky_linux_version}-optimized-gcp-arm" --format="value(name)")
m4 --define=ROCKY_VERSION=${rocky_linux_version} flux-compute-builder-startup-script.m4 > flux-compute-builder-startup-script.sh
gcloud builds submit --config=computebuild.yaml --substitutions=_ZONE=${zone},_ENABLE_SECURE_BOOT=false,_MACHINE_ARCHITECTURE="arm64",_MACHINE_TYPE=${arm_machine_type},_SOURCE_IMAGE=${source_image},_SUBNETWORK=${subnetwork} .
gcloud builds submit --config=computebuild.yaml --substitutions=_ZONE=${zone},_ENABLE_SECURE_BOOT=false,_MACHINE_ARCHITECTURE="arm64",_MACHINE_TYPE=${arm_machine_type},_SOURCE_IMAGE=${source_image},_SUBNETWORK=${subnetwork} --verbosity=debug .
fi

if [ "X${x86_machine_type}" != "X" ]; then
source_image=$(gcloud compute images list --filter="name ~ rocky-linux-${rocky_linux_version}-optimized-gcp-v" --format="value(name)")
m4 --define=ROCKY_VERSION=${rocky_linux_version} --define=X86_64 flux-compute-builder-startup-script.m4 > flux-compute-builder-startup-script.sh
gcloud builds submit --config=computebuild.yaml --substitutions=_ZONE=${zone},_MACHINE_ARCHITECTURE="x86-64",_MACHINE_TYPE=${x86_machine_type},_SOURCE_IMAGE=${source_image},_SUBNETWORK=${subnetwork} .
gcloud builds submit --config=computebuild.yaml --substitutions=_ZONE=${zone},_MACHINE_ARCHITECTURE="x86-64",_MACHINE_TYPE=${x86_machine_type},_SOURCE_IMAGE=${source_image},_SUBNETWORK=${subnetwork} --verbosity=debug .
fi
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ ifdef(`X86_64', `include(install_apptainer.txt)')dnl
useradd -M -r -s /bin/false -c "flux-framework identity" flux
# Update grub
include(update_cgroups.txt)dnl
cd /usr/share
git clone -b v0.49.0 https://github.com/flux-framework/flux-core.git
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ dnf install -y podman

useradd -M -r -s /bin/false -c "flux-framework identity" flux

# Update grub
include(update_cgroups.txt)dnl

cd /usr/share

git clone -b v0.49.0 https://github.com/flux-framework/flux-core.git
Expand Down
6 changes: 4 additions & 2 deletions google/rootless-kubernetes/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@ I'm using my personal account for now so I'm being conservative, and likely I'll
- [K3D with rootless Podman](https://k3d.io/v5.4.9/usage/advanced/podman/?h=podman): this could actually be something we could try out of the box. The main flux job would need to launch a batch, where each worker launches a container, and there is a main task to bring the cluster together.
- [K3s docker compose](k3s-docker-compose): if I can get this working with Docker Compose, Singularity compose would be my next thing to try.
- [sysbox](sysbox)
- usernetes TBA

- [usernetes-compose](usernetes-compose) is testing out usernetes with docker-compsoe.
### Likely No

- [Kind](https://github.com/kubernetes-sigs/kind/issues/1928) would not work across multiple machines, and likely wouldn't be a good choice.
- MiniKube: as far as I can tell, the multiple drivers are assuming multi-node cluster on a single machine.
- [MicroK8s](https://microk8s.io/docs/clustering) does have support for running a cluster across machines, so promising, but I don't see rootless support. I am likely going to try it for learning anyway.


Note that k3s is almost there but has [this issue](https://github.com/k3s-io/k3s/discussions/7615#discussioncomment-6016006).
42 changes: 42 additions & 0 deletions google/rootless-kubernetes/usernetes-compose/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# usernetes-compose

I asked if [there could be support for multiple hosts](https://github.com/rootless-containers/usernetes/issues/281)
and indeed this was possible. I first wanted to try this docker-compose setup. We will
follow the instructions [here](https://github.com/rootless-containers/usernetes/tree/v20230518.0#multi-node-docker-compose).
The goal here is to understand what CIDR addresses are and how we can extend this functionality
to k3s.

## Setup

Clone the repository at this release.

```bash
$ git clone -b v20230518.0 https://github.com/rootless-containers/usernetes
cd usernetes
make up
```

When the cluster is donec creating (and the kubeconfig file will be saved to your host)
you'll want to set it and then use it. E.g.,

```bash
$ export KUBECONFIG=$HOME/.config/usernetes/docker-compose.kubeconfig
```
And then it works!

```
$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
node-containerd Ready <none> 2m20s v1.27.2
node-crio Ready <none> 2m20s v1.27.2
```

Nice!

When you are done playing around:

```bash
$ make down
```

From this point on I want to build this into VMs in [this repository](https://github.com/converged-computing/flux-terraform-gcp).

0 comments on commit 2070bc4

Please sign in to comment.