diff --git a/README.md b/README.md index 2fe1175..f60c6df 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,7 @@ # Infra setup -- VPS - - nilstrieb.dev - - docker.nilstrieb.dev +see `new` for the new infra -- Github Pages - - blog.nilstrieb.dev +## things that shall not be forgotten -nilstrieb.dev redirects to blog.nilstrieb.dev - -docker.nilstrieb.dev proxies to an internal registry container. - -The VPS has an nginx server at the front. - -# useful links -## Install mongosh -https://www.mongodb.com/docs/mongodb-shell/install/#std-label-mdb-shell-install - -# fresh setup - -Follow the README in `scripts/README.md` \ No newline at end of file +there once was some custom k8s cluster setup in `./k8s-cluster`. it was incomplete and pretty cursed. \ No newline at end of file diff --git a/full_setup.sh b/full_setup.sh deleted file mode 100755 index d370cd3..0000000 --- a/full_setup.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env bash -set -eu pipefail - -./docker/setup_net.sh - -./registry/run.sh -./nginx/run.sh \ No newline at end of file diff --git a/html.html b/html.html deleted file mode 100644 index b426ad6..0000000 --- a/html.html +++ /dev/null @@ -1,12 +0,0 @@ - - - - - - - uwu - - - meow :3 - - \ No newline at end of file diff --git a/k8s-cluster/README.md b/k8s-cluster/README.md deleted file mode 100644 index 46808ee..0000000 --- a/k8s-cluster/README.md +++ /dev/null @@ -1,84 +0,0 @@ -https://kubernetes.io/docs/setup/production-environment/tools/kubeadm/create-cluster-kubeadm/ - -- make sure that swap is disabled - -# containerd runtime - -https://github.com/containerd/containerd/blob/main/docs/getting-started.md - -```sh -# containerd -CRD_VERSION="1.7.0" - -curl -L "https://github.com/containerd/containerd/releases/download/v$VERSION/containerd-$VERSION-linux-amd64.tar.gz" -o "containerd-$VERSION-linux-amd64.tar.gz" -sudo tar Cxzvf /usr/local "containerd-$CRD_VERSION-linux-amd64.tar.gz" -sudo mkdir -p /usr/local/lib/systemd/system -sudo curl https://raw.githubusercontent.com/containerd/containerd/main/containerd.service -o /usr/local/lib/systemd/system/containerd.service -sudo systemctl daemon-reload -sudo systemctl enable --now containerd -``` - -```sh -# runc -RUNC_VERSION="1.1.4" - -curl -L "https://github.com/opencontainers/runc/releases/download/v$RUNC_VERSION/runc.amd64" -o runc.amd64 -sudo install -m 755 runc.amd64 /usr/local/sbin/runc -``` - -```sh -# cni plugin -CNIP_VERSION="1.2.0" - -curl -L "https://github.com/containernetworking/plugins/releases/download/v$CNIP_VERSION/cni-plugins-linux-amd64-v$CNIP_VERSION.tgz" -o "cni-plugins-linux-amd64-v$CNIP_VERSION.tgz" -sudo mkdir -p /opt/cni/bin -sudo tar Cxzvf /opt/cni/bin "cni-plugins-linux-amd64-v$CNIP_VERSION.tgz" -``` - -```sh -mkdir -p /etc/containerd -sudo bash -c 'containerd config default > /etc/containerd/config.toml' -``` - -Set to true in `/etc/containerd/config.toml` - -```toml -[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc] - ... - [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options] - SystemdCgroup = true -``` - -```sh -sudo systemctl restart containerd -``` - - -# set it up - -``` -sudo kubeadm init --control-plane-endpoint=k8s-control.nilstrieb.dev --pod-network-cidr=192.168.0.0/16 - -kubectl create -f https://raw.githubusercontent.com/projectcalico/calico/v3.25.0/manifests/tigera-operator.yaml -``` - -# networking - -[callico](https://docs.tigera.io/calico) - -# other - -`kubectl taint nodes --all node-role.kubernetes.io/control-plane-` to allow scheduling on the control plane. disable if needed. - -# sonobuoy - -```sh -SONO_VERSION=0.56.16 - -curl -L "https://github.com/vmware-tanzu/sonobuoy/releases/download/v$SONO_VERSION/sonobuoy_$(echo $SONO_VERSION)_linux_amd64.tar.gz" -o "sonobuoy_$(echo $SONO_VERSION)_linux_amd64.tar.gz" -tar -xvf "sonobuoy_$(echo $SONO_VERSION)_linux_amd64.tar.gz" -``` - -```sh -./sonobuoy run --wait -``` \ No newline at end of file diff --git a/k8s-cluster/custom-resources.yaml b/k8s-cluster/custom-resources.yaml deleted file mode 100644 index 1d2e08d..0000000 --- a/k8s-cluster/custom-resources.yaml +++ /dev/null @@ -1,27 +0,0 @@ -# This section includes base Calico installation configuration. -# For more information, see: https://projectcalico.docs.tigera.io/master/reference/installation/api#operator.tigera.io/v1.Installation -apiVersion: operator.tigera.io/v1 -kind: Installation -metadata: - name: default -spec: - # Configures Calico networking. - calicoNetwork: - # Note: The ipPools section cannot be modified post-install. - ipPools: - - blockSize: 26 - cidr: 192.168.0.0/16 - encapsulation: VXLANCrossSubnet - natOutgoing: Enabled - nodeSelector: all() - ---- - -# This section configures the Calico API server. -# For more information, see: https://projectcalico.docs.tigera.io/master/reference/installation/api#operator.tigera.io/v1.APIServer -apiVersion: operator.tigera.io/v1 -kind: APIServer -metadata: - name: default -spec: {} - diff --git a/k8s-cluster/example-deployment.yaml b/k8s-cluster/example-deployment.yaml deleted file mode 100644 index 5c45d8d..0000000 --- a/k8s-cluster/example-deployment.yaml +++ /dev/null @@ -1,29 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: hello-world -spec: - selector: - matchLabels: - app: hello-world - template: - metadata: - labels: - app: hello-world - spec: - containers: - - name: hello-world - image: nginx:latest - ports: - - containerPort: 80 ---- -apiVersion: v1 -kind: Service -metadata: - name: hello-world-service -spec: - selector: - app: hello-world - ports: - - port: 80 - targetPort: 4000 diff --git a/k8s-cluster/kubelet.yaml b/k8s-cluster/kubelet.yaml deleted file mode 100644 index cab4849..0000000 --- a/k8s-cluster/kubelet.yaml +++ /dev/null @@ -1,3 +0,0 @@ -apiVersion: kubelet.config.k8s.io/v1beta1 -kind: KubeletConfiguration -cgroupDriver: systemd diff --git a/new/vps2/Caddyfile b/new/vps2/Caddyfile index d2701ef..41e91f9 100644 --- a/new/vps2/Caddyfile +++ b/new/vps2/Caddyfile @@ -1,6 +1,5 @@ { email nilstrieb@gmail.com - # acme_ca https://api.letsencrypt.org/directory } # https://gist.github.com/ryanburnette/d13575c9ced201e73f8169d3a793c1a3 diff --git a/old-kube/karin-secret.yaml b/old-kube/karin-secret.yaml deleted file mode 100644 index d52b22c..0000000 --- a/old-kube/karin-secret.yaml +++ /dev/null @@ -1,6 +0,0 @@ -apiVersion: v1 -data: - DISCORD_TOKEN: QQ== -kind: Secret -metadata: - name: karin \ No newline at end of file diff --git a/old-kube/karin.yaml b/old-kube/karin.yaml deleted file mode 100644 index ff7f749..0000000 --- a/old-kube/karin.yaml +++ /dev/null @@ -1,34 +0,0 @@ -apiVersion: apps/v1 -kind: Deployment -metadata: - name: karin -spec: - selector: - matchLabels: - app: karin - replicas: 1 - template: - metadata: - labels: - app: karin - spec: - containers: - - name: court-bot - image: discord-court-bot:1.0 - envFrom: - - configMapRef: - name: karin - - secretRef: - name: karin - - secretRef: - name: mongodb ---- -apiVersion: v1 -kind: ConfigMap -metadata: - name: karin -data: - RUST_LOG: DEBUG - GUILD_ID: "459006129670979584" - DB_NAME: karin - SET_GLOBAL: '' \ No newline at end of file diff --git a/old-kube/mongo-secret.yaml b/old-kube/mongo-secret.yaml deleted file mode 100644 index 2942326..0000000 --- a/old-kube/mongo-secret.yaml +++ /dev/null @@ -1,8 +0,0 @@ -apiVersion: v1 -data: - MONGO_URI: bW9uZ29kYjovL21vbmdvLTAubW9uZ28uZGVmYXVsdC5zdmMuY2x1c3Rlci5sb2NhbDoyNzAxNw== - MONGO_INITDB_ROOT_USERNAME: cm9vdA== - MONGO_INITDB_ROOT_PASSWORD: QQ== -kind: Secret -metadata: - name: mongodb \ No newline at end of file diff --git a/old-kube/mongo.yaml b/old-kube/mongo.yaml deleted file mode 100644 index 5cb2a43..0000000 --- a/old-kube/mongo.yaml +++ /dev/null @@ -1,57 +0,0 @@ -apiVersion: v1 -kind: Service -metadata: - name: mongo - labels: - app: mongo -spec: - ports: - - port: 27017 - name: mongodb - clusterIP: None - selector: - app: mongo ---- -apiVersion: apps/v1 -kind: StatefulSet -metadata: - name: mongo -spec: - serviceName: mongo - selector: - matchLabels: - app: mongo - replicas: 1 - template: - metadata: - labels: - app: mongo - spec: - containers: - - name: mongo - image: mongo:latest - command: - - "mongod" - - "--bind_ip" - - "0.0.0.0" - resources: - limits: - cpu: 400m - memory: 200M - ports: - - containerPort: 27017 - volumeMounts: - - name: mongodb-data - mountPath: /data/db - envFrom: - - secretRef: - name: mongodb - volumeClaimTemplates: - - metadata: - name: mongodb-data - spec: - accessModes: [ "ReadWriteOnce" ] - storageClassName: "standard" - resources: - requests: - storage: 100M \ No newline at end of file diff --git a/scripts/README.md b/scripts/README.md deleted file mode 100644 index 07977d6..0000000 --- a/scripts/README.md +++ /dev/null @@ -1,23 +0,0 @@ -# Setup - -## Setup host - -- Install docker -- Install minikube (https://minikube.sigs.k8s.io/docs/start/) -- Install helm (https://helm.sh/docs/intro/install/) -- Run `setup-env.sh` - -## Start minikube - -`minikube start` - -`./scripts/minikube-setup` - -## Install cert-manager - -`./scripts/cert-manager.sh` -i -## Apply configs - -First, apply all the configs in `./kube` directly. Only apply `server-ingress.yaml`, not `local-ingress.yaml`! -Then, apply all configs in `./kube/apps`. \ No newline at end of file diff --git a/scripts/cert-manager.sh b/scripts/cert-manager.sh deleted file mode 100755 index 86c3c57..0000000 --- a/scripts/cert-manager.sh +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/env sh - -# https://getbetterdevops.io/k8s-ingress-with-letsencrypt/ - -helm repo add jetstack https://charts.jetstack.io -helm repo update -helm install cert-manager jetstack/cert-manager --namespace cert-manager --create-namespace --set installCRDs=true \ No newline at end of file diff --git a/scripts/minikube-setup.sh b/scripts/minikube-setup.sh deleted file mode 100644 index c1b02bd..0000000 --- a/scripts/minikube-setup.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env sh - -minikube addons enable ingress -minikube addons enable ingress-dns \ No newline at end of file diff --git a/scripts/setup-env.sh b/scripts/setup-env.sh deleted file mode 100755 index 0ef21ac..0000000 --- a/scripts/setup-env.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/usr/bin/env sh - -if kubectl cert-manager 2>/dev/null >/dev/null ; -then - echo "The cert-manger kubectl plugin is already installed" -else - CERT_MANAGER_KUBECTL_VERSION="v1.6.1" - - echo "Installing the cert-manager kubectl plugin: $CERT_MANAGER_KUBECTL_VERSION" - - curl -L -o kubectl-cert-manager.tar.gz "https://github.com/jetstack/cert-manager/releases/download/$CERT_MANAGER_KUBECTL_VERSION/kubectl-cert_manager-linux-amd64.tar.gz" - tar xzf kubectl-cert-manager.tar.gz - sudo mv kubectl-cert_manager /usr/local/bin -fi diff --git a/test/Dockerfile b/test/Dockerfile deleted file mode 100644 index 946e9b6..0000000 --- a/test/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -FROM ubuntu:latest - -CMD ["echo", "Hello, World!"] \ No newline at end of file diff --git a/test/local-commands.sh b/test/local-commands.sh deleted file mode 100644 index 9d443a6..0000000 --- a/test/local-commands.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/usr/bin/env sh - -# Hugo frontend: -curl -H "Host: hugo-chat.nilstrieb.dev" 127.0.0.1/index.html \ No newline at end of file