Skip to content

Instantly share code, notes, and snippets.

@bpmct
Last active June 18, 2021 06:15
Show Gist options
  • Save bpmct/e56a9bc4925013d847ef057673748b99 to your computer and use it in GitHub Desktop.
Save bpmct/e56a9bc4925013d847ef057673748b99 to your computer and use it in GitHub Desktop.

Installing Coder on k3s

  1. Create an Ubuntu 20.10 machine with the minimum system requirements for Coder, and as many running workspaces as you need.
  2. Install kubectl and helm
  3. Change the SSH port to 5522 and restart SSH: guide
  4. Set up a k3s cluster with Calico, following this guide: https://docs.projectcalico.org/getting-started/kubernetes/k3s/quickstart
  5. If you run into an error installing Calico OR installing Coder with helm, set kubeconfig var ~/.bashrc: k3s-io/k3s#1126 (comment)
  6. Edit /etc/cni/net.d/10-calico.conflist and set allow_ip_forwarding to true.
  7. [To be safe] Set allow_ip_forwarding to true in the ConfigMap as well: kubectl edit cm cni-config -n calico-system
  8. Install Coder as normal: https://coder.com/docs/setup/installation

You may need to configure your firewall to open these ports:

5522 - SSH into Coder VM
22 - SSH into workspaces
80 - HTTP web server
443 HTTPS web server

--

Tested

✅ Dev URLs

✅ SSH into workspaces

✅ HTTPs (root domain and dev URLs)

✅ CVMs (Docker inside workspaces)

You will still need to configure these features, as you would on any Coder deployment

FAQ

What if I need more space?

You've got options! You can upgrade your machine, add another k3s node, or add another workspace provider in Coder.

How do I migrate?

You can migrate the builtin postgreSQL database, but you should drop the workspaces table. Your workspaces are not saved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment