Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is still a work in progress.
This PR migrates user workspaces from Docker to Kubernetes in order to support multi-node deployments of the dojo. The goal is to still support single-node (for easy development, and smaller deployments), while making it possible for user workspaces to appear on other nodes in larger deployments.
In multi-node deployments, there will be a primary node that hosts all of the core infrastructure (site, db, redis, nginx, discord bot, etc). That primary node will also spin up a container that acts as the kubernetes "server" (in control). Other nodes will only spin up a kubernetes "agent" (worker) to house the user workspaces.
For example on the primary node:
$ docker run -it --rm --privileged -e DOJO_HOST=pwn.college -p 22:22 -p 80:80 -p 443:443 -v $PWD/data:/opt/pwn.college/data pwncollege/dojo
And on any worker
$ docker run -it --rm --privileged -e DOJO_SERVER=pwn.college -e DOJO_SECRET=112233445566778899aabbccddeeff -v $PWD/data:/opt/pwn.college/data pwncollege/dojo
Once a worker completes its setup and connect-in process to the primary node, user workspaces may now be scheduled to run there.
The goal of this PR is not to run other services (the site, db, etc) in kubernetes. However, we might later decide to migrate those services there if it makes sense.
I am going to be storing TODOs, thoughts, brainstorming, etc. here as I continue to build this out.
Registry
COPY / /
; why is this not fast?Networking
ip route add 10.42.0.0/16 via $(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}} dev br-{{slice .NetworkID 0 12}}{{end}}' kube-server)
on the infrastructure container.Security
Services
$(hostname -I | awk '{print $1}')
(just$(hostname -I)
in single-interface setup) to get the ip of the container, and bind to thatSSH
NFS
ps aux | grep ' D'
to see if there are any (NFS) processes inD
state.docker kill dojo
)?ZFS
Flag
Misc