Welcome to working with Self-Service things using Coder . You'll be using various clouds (Azure, GCP and Openstack), but mostly this is entirely hidden from you and you will see only GCP.
Last Updated: 2024-01-17
The best scalability and cost efficiency is achieved, if people can self-solve the exact right amount of problems. This is such an attempt
We will cover the following topics:
Yes, but for that someone else would have to write the docs ( I m more than happy to help them)
First, choose what you want to provision yourself , so go to Templates, and "Create Workspace
". Now you need to enter some stuff (depending on the template).
Let's say we start with k8s , that is very reasonable, because it's the easiest to manage and potentially the cheapest.
Lets begin with the ♥️ Template: Give it your favourite name, and check the VolumeSize suits you (1 Gb is enough if you're just clicking around) and select "Create Workspace
".
Now, we wait, here the logs are telling us that GKE needs to first create a node of the correct type (that node-pool has size=0 by default) and whenever a new node spins up, may take couple of minutes.
On the GCP backend, we are essentially waiting for the following condition (user-pool now has size=1).
I m using it tonight for playing a CTF game:
Now, you can choose a webshell check any buttons as you like
You have sudo and root privileges.
The authentication works via the local service account (which is why you dont need a nasty token, like for the VMs)
See the terraform definition of this template here https://github.com/AustrianDataLAB/coder-templates/blob/features/aocc/kubernetes-gke-gvisor/main.tf
(Also on gvisor/apparmour, same as above, but now with portfwd). For this, select the 🍀 template.
Let's do something more fancy (now that I've figured out how to get port forwarding to work): a software "Metabase", that is installed next to vscode and runs on a separate port
And: connects itself to various databases, collects their data and you can create views and/or analytics.
Definition is here: https://github.com/AustrianDataLAB/coder-templates/blob/features/aocc/kubernetes-gke-metabase/main.tf
Please select the 🖤template , this is an example of using template to configure the templates (yes... the usual, right 😂 )
So, this guy is gonna take A WHILE to load, cause I'm letting it install approx three universes .. more as a showcase, how you can customize this thingy.
WIP: a lot of apps don't seem happy ATM, more debugging is required. It is weird that you can't just copy paste stuff from the internet, and expect it to work. Bah
The port forwarding works nicely though. So you can open Rstudio as Popup or in a separate Tab
You can specify to prepolutate your environment using a *.json standard = devcontainer.json which you need to have avail somewhere on git.
Also, you can auto-pull any compatible image currently I put node, go and python (but there are plenty more)
Ok, so lets take this to the next level and run something arbitrary (currently it requires a debian/ubuntu base, but hey, you could change that if you really wanted to)
Lets run mongo:6.0-jammy
If you want a VM, and have been onboarded to GCP, please get yourself a token like so:
If not, ask Constanze for one (it'll expire quickly, so beware). She is working on a more hidden type of federated authN...
If , at any point, you get the following error, ask C to give you a fresh token, enter it in "Settings". And then "Retry"
Mostly very straightforward ...
You can do all sorts of init-scripts, you can pre-bake images. All the VM stuff that we know well
You can port forward like so:
I'm pretty sure that someone that understands how to use an RDP client, can get RDP to work. For now; PowerShell and SSH (you need the CLI for that clientside).
You can give the Windows-Template a try , it also shows how to provide documentation and a password along with the environment.
What we can do here is ssh from the CLI , though
❯ coder login https://coder.caas-0010.dev.austrianopencloudcommunity.org
Your browser has been opened to visit:
https://coder.caas-0010.dev.austrianopencloudcommunity.org/cli-auth
❯ coder config-ssh
❯ coder ssh winnie.main
Coming soon
I am collecting working templates in this repo (originally a fork from someone who had a very similar idea), this also give you a good sense of what's possible https://github.com/AustrianDataLAB/coder-templates
$ git clone git@github.com:AustrianDataLAB/coder-templates.git
K8s rulez cause the coder deployment is relatively easy as long as you have a very solid k8s with all utils (cert-manager, kata-container/gvisor/selinux, k8s lives in a private network) etc
How much do you need to adapt?
Mostly the fancy stuff , like GPU, or mounting special things
These are now very different, cause you need to write the terraform for the target cloud, plus provide the AuthN for the cloud that your coder-instance runs on.
So, in the repo, I m collecting stuff that works for TUW-AOCC (meaning, the multi-hybrid cloud mix of Azure, GCP and Openstack)
$ git clone git@github.com:AustrianDataLAB/coder-templates.git
For example, lets say you want the k8s-gke-template
In a fresh coder env, create a sample template until it compiles and then modify the terraform source code by copy-paste the main.tf file.
Debug until working, done.
Coming soon
A bash command
You can embed the portal like this
Once your workplace is provisioned, please press the Terminal button on the right, and a webterminal will appear. Otherwise choose the service you want (e.g. VSCODE)
Congratulations, you've successfully completed this training