Skip to content

Latest commit

 

History

History
158 lines (111 loc) · 3.17 KB

runbook.org

File metadata and controls

158 lines (111 loc) · 3.17 KB

Setup

These are the perquisites before running

Install Dependencies

Docker

sudo apt install docker-ce

k3d

https://k3d.io/v5.4.6/#installation

wget -q -O - https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash

Earthly

https://earthly.dev/get-earthly

sudo /bin/sh -c 'wget https://github.com/earthly/earthly/releases/latest/download/earthly-linux-amd64 -O /usr/local/bin/earthly \
     && chmod +x /usr/local/bin/earthly \
     && /usr/local/bin/earthly bootstrap --with-autocomplete'

Devspace

https://www.devspace.sh/docs/getting-started/installation

curl -L -o devspace "https://github.com/loft-sh/devspace/releases/latest/download/devspace-linux-amd64" \
    && sudo install -c -m 0755 devspace /usr/local/bin

Clojure

https://clojure.org/guides/install_clojure#_linux_instructions

CLOJURE_VERSION=1.11.1.1208 \
  curl -O https://download.clojure.org/install/linux-install-${CLOJURE_VERSION}.sh \
  && chmod +x linux-install-${CLOJURE_VERSION}.sh \
  && sudo ./linux-install-${CLOJURE_VERSION}.sh

Create Cluster Environment

Create Registry

This will create a registry to share created images with the cluster

k3d registry create myregistry.localhost --port 12345

Create Cluster

This will create a single node kubernetes cluster in a docker container

k3d cluster create \
    --api-port 6550 \
    -p "80:80@loadbalancer" \
    -p "443:443@loadbalancer" \
    --servers 1 \
    --registry-use k3d-myregistry.localhost:12345 \
    --kubeconfig-update-default

install cert-manager

https://cert-manager.io/docs/installation/kubectl/

install cert manager manifests

kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.10.1/cert-manager.yaml

Create letsencrypt provider

EMAIL=someuser@example.com cat <<EOF | kubectl apply -f -
apiVersion: cert-manager.io/v1
kind: ClusterIssuer
metadata:
  name: letsencrypt-prod
spec:
  acme:
    server: https://acme-v02.api.letsencrypt.org/directory
    email: ${EMAIL}
    privateKeySecretRef:
      name: letsencrypt-prod
    solvers:
    - http01:
        ingress:
          class: traefik
EOF

Create namespace

kubectl create namespace untethr

Update values file

cp values-example.yaml values.yaml

Fill in the missing information and update the url in the 3 places

Build

Deploy

devspace deploy

Test

devspace run-pipeline test

Cleaning up

Delete Cluster

k3d cluster delete k3s-default

Delete Registry

k3d registry delete k3d-myregistry.localhost

Running

Docker

docker run -it \
       -v $(pwd)/conf:/app/conf \
       -v $(pwd)/n.db:/app/data/n.db \
       -p 9090:9090 \
       duck1123/me.untethr.nostr-relay:latest