Skip to content

Instantly share code, notes, and snippets.

View bpmct's full-sized avatar
🥝

Ben Potter bpmct

🥝
View GitHub Profile

Keybase proof

I hereby claim:

  • I am bpmct on github.
  • I am bpmct (https://keybase.io/bpmct) on keybase.
  • I have a public key ASAkss1PtU-XsRxjQ42MQy7aAywetYLAmboTvTJIXpHBOAo

To claim this, I am signing this object:

@bpmct
bpmct / k3s.md
Last active June 18, 2021 06:15

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
@bpmct
bpmct / deploy-code-server.md
Last active March 3, 2021 07:23
deploy-code-server.md

deploy-code-server

A collection of one-click buttons and tutorials for deploying code-server to various cloud hosting platforms. The fastest way to get a code-server environment! ☁️

Platform Type Cheapest Plan Deploy
DigitalOcean VM Test
Vultr VM $10 credit Test
Railway App Platform Test
Heroku App Platform Test
@bpmct
bpmct / coder-image-best-practices.md
Last active February 25, 2021 20:48
image best practices

Writing Coder Dockerfiles

It often makes sense to create a custom images that include the dependencies, scripts, preferences necessary for development. For information on how to create, build push Docker images, follow this tutorial by Docker.

As a start, we recommdend you start by extending one of our Enterprise Example Images and extending them. If you need to use another base image, we recommend reading over our image minimums to ensure the image works with most Coder features.

FROM codercom/enterprise-base:ubuntu

RUN apt-get install -y ...
COPY file ./

Notes for installing codekube

  • A git submodule init && git submodule update is necessary after the git clone, or person should clone with:
git clone --recurse-submodules -j8 https://git.nofla.me/k8s-projects/kubecfg-public
  • In google cloud, I had to change the service type to a LoadBalancer manually.

I started (from /docs on 01.31.20)

Note: The most recent docs on https://coder.com/docs/setup/kubernetes/google include clearer install docs.

PROJECT_ID="MY_PROJECT_ID" CLUSTER_NAME="MY_CLUSTER_NAME" \
  gcloud beta container --project "$PROJECT_ID" \
  clusters create "$CLUSTER_NAME"
    --zone "us-central1-a" \
   --no-enable-basic-auth \

Setup

  • Create environment with image bencdr/next-app
  • Open with VS Code or Terminal

Developing

  • Clone with create-next-app
  • npx create-next-app --example blog-starter blog-starter-app
  • cd blog-starter-app && yarn dev

Setup

  • Configure git
  • Install nvm
  • Install node 10
  • Install create-next app

Developing

  • Clone with create-next-app
  • npx create-next-app --example blog-starter blog-starter-app
  • cd blog-starter-app && yarn dev

Moving from Visual Studio Codespaces to code-server

Recently, Microsoft announced that all VS Codespaces are migrating to GitHub. At this time, support for self-hosted Codespaces will be removed in favor of GitHub's cloud environments.

If you are looking to host a VS Code server on your own infastructure, code-server is the solution.

  • Use VS Code in the browser (terminal, integrations, extensions) 🧩
  • Authenticate via password (or another auth + reverse proxy) 🔑
  • Encrypt with HTTPS 🔒
  • Host on any machine (Mac, Linux, WSL) 🖥