These are the perquisites before running
sudo apt install docker-ce
This is used to create a local kubernetes cluster
https://k3d.io/v5.7.4/#installation
wget -q -O - https://raw.githubusercontent.com/k3d-io/k3d/main/install.sh | bash
This is used for building images
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'
This is used for deploying resources to your local dev cluster
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
This is an optional step.
alias d="devspace"
alias dr="devspace run"
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
This will create a registry to share created images with the cluster
k3d registry create myregistry.localtest.me --port 12345
This will create a single node kubernetes cluster in a docker container and update the default kubeconfig
k3d cluster create \
--api-port 6550 \
-p "80:80@loadbalancer" \
-p "443:443@loadbalancer" \
--k3s-arg "--disable=traefik@server:0" \
--servers 1 \
--registry-use k3d-myregistry.localtest.me:12345 \
--kubeconfig-update-default
https://cert-manager.io/docs/installation/kubectl/
Install cert-manager CRDs into the cluster.
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.12.0/cert-manager.yaml
Create cluster issuer record.
This will cause any ingress with the appropriate annotations to obtain a certificate from letsencrypt
[email protected] 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
kubectl create namespace dinsro
devspace deploy
rm -rf node_modules
bb install
docker run -it -p 3000:3000 duck1123/dinsro:latest
Delete registry for locally-built images
k3d registry delete k3d-myregistry.localtest.me
Completely destroy dev cluster
k3d cluster delete k3s-default
Clears all earthly caches
earthly prune
Removes devimage from pod and resets to default
devspace reset pods