Skip to content

Instantly share code, notes, and snippets.

@clemenko
Created October 9, 2024 18:27
Show Gist options
  • Save clemenko/fb17e6ffe550d94dd0a6366aaff73fe2 to your computer and use it in GitHub Desktop.
Save clemenko/fb17e6ffe550d94dd0a6366aaff73fe2 to your computer and use it in GitHub Desktop.

Coder Basic Install Guide - from a firefighter. :D

Resources

Here are a few links that I used to understand all things Coder.

Install k8s

Here is the two one liner I used to install rke2, helm, and longhorn.

curl -sfL https://get.rke2.io | sh - && systemctl enable --now rke2-server.service && echo "export KUBECONFIG=/etc/rancher/rke2/rke2.yaml PATH=$PATH:/usr/local/bin/:/var/lib/rancher/rke2/bin/" >> ~/.bashrc && source ~/.bashrc && curl -sfL https://get.hauler.dev | bash && curl -s https://raw.githubusercontent.com/helm/helm/main/scripts/get-helm-3 | bash

yum install -y nfs-utils cryptsetup iscsi-initiator-utils; systemctl enable --now iscsid; helm repo add longhorn https://charts.longhorn.io --force-update; helm upgrade -i longhorn  longhorn/longhorn -n longhorn-system --create-namespace

Coder Install

From the video.

# set up namespace - cleaned
# kubectl create namespace coder

# add helm repo
helm repo add bitnami https://charts.bitnami.com/bitnami --force-update

helm upgrade -i coder-db bitnami/postgresql -n coder --create-namespace --set auth.username=coder --set auth.password=coder --set auth.database=coder --set persistence.size=10Gi

kubectl create secret generic coder-db-url -n coder --from-literal=url="postgres://coder:[email protected]:5432/coder?sslmode=disable"

helm repo add coder-v2 https://helm.coder.com/v2 --force-update

cat << EOF >> values.yaml
coder:
  env:
    - name: CODER_PG_CONNECTION_URL
      valueFrom:
        secretKeyRef:
          name: coder-db-url
          key: url

    - name: CODER_ACCESS_URL
      value: "http://coder.192.168.1.101.sslip.io"

  ingress:
    enable: true
    host: "coder.192.168.1.101.sslip.io"
EOF

helm upgrade -i coder coder-v2/coder --namespace coder --values values.yaml

And the cli install

# local cli install
curl -L https://coder.com/install.sh | sh

coder login http://coder.192.168.1.101.sslip.io/
coder config-ssh

Hope this helps!

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