cluster

Infrastructure files for Nordgedanken and Midnightthoughts.
git clone git://archive.git.mtrnord.blog/MTRNord/cluster.git
Log | Files | Refs | README

commit 64a58c24173634ca768250861e82a752cdd8a084
parent 09810b5aa45b6d1c89fc77e39643c9b81e1f609a
Author: MTRNord <MTRNord@users.noreply.github.com>
Date:   Sat, 29 Nov 2025 13:46:37 +0100

apply env and reformat

Signed-off-by: MTRNord <MTRNord@users.noreply.github.com>

Diffstat:
Mapps/talos_cluster/bookwyrm/deployment.yaml | 637++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-------------
Mapps/talos_cluster/bookwyrm/initJob.yaml | 184++++++++++++++++++++++++++++++++++++++++----------------------------------------
Mapps/talos_cluster/bookwyrm/keydb.yaml | 10+++++-----
Mapps/talos_cluster/bookwyrm/kustomization.yaml | 6+++---
Mapps/talos_cluster/envoy-gateway/gateway_settings.yaml | 452++++++++++++++++++++++++++++++++++++++++----------------------------------------
Minfrastructure_talos/configs/cnpg-cluster.yaml | 46+++++++++++++++++++++++-----------------------
Minfrastructure_talos/controllers/cert-manager.yaml | 5++---
7 files changed, 884 insertions(+), 456 deletions(-)

diff --git a/apps/talos_cluster/bookwyrm/deployment.yaml b/apps/talos_cluster/bookwyrm/deployment.yaml @@ -1,4 +1,3 @@ ---- # Persistent Volume Claim for BookWyrm static, exports and media files apiVersion: v1 kind: PersistentVolumeClaim @@ -38,148 +37,578 @@ spec: volumes: - name: bookwyrm-script configMap: - name: bookwyrm-script + name: bookwyrm-script - name: bookwyrm-data persistentVolumeClaim: - claimName: bookwyrm-pvc + claimName: bookwyrm-pvc initContainers: - name: bookwyrm-update image: ghcr.io/mtrnord/bookwyrm:v0.8.2 imagePullPolicy: Always command: ["bash"] args: - - /hl/bookwyrm.sh - - update + - /hl/bookwyrm.sh + - update volumeMounts: - - name: bookwyrm-script - mountPath: /hl - readOnly: true - - name: bookwyrm-data - mountPath: /app/static - subPath: static - - name: bookwyrm-data - mountPath: /app/media - subPath: media - - name: bookwyrm-data - mountPath: /app/exports - subPath: exports + - name: bookwyrm-script + mountPath: /hl + readOnly: true + - name: bookwyrm-data + mountPath: /app/static + subPath: static + - name: bookwyrm-data + mountPath: /app/media + subPath: media + - name: bookwyrm-data + mountPath: /app/exports + subPath: exports env: + - name: POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: DEBUG + value: "false" + - name: ALLOWED_HOSTS + value: "books.mtrnord.blog,localhost,$(POD_IP)" + - name: SECRET_KEY + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: SECRET_KEY + - name: DOMAIN + value: "books.mtrnord.blog" + - name: USE_HTTPS + value: "true" + - name: PGPORT + value: "5432" + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: POSTGRES_PASSWORD + - name: POSTGRES_USER + value: "bookwyrm" + - name: POSTGRES_DB + value: "bookwyrm" + - name: POSTGRES_HOST + value: "pg-cluster-v2-rw.postgres-cluster.svc.cluster.local" + # TODO: Setup Redis + - name: REDIS_ACTIVITY_URL + value: "redis://bookwyrm-keydb.bookwyrm.svc.cluster.local:6379/0" + - name: REDIS_BROKER_URL + value: "redis://bookwyrm-keydb.bookwyrm.svc.cluster.local:6379/1" + - name: FLOWER_USER + value: "bookwyrm" + - name: FLOWER_PASSWORD + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: FLOWER_PASSWORD + - name: FLOWER_BASIC_AUTH + value: "$(FLOWER_USER):$(FLOWER_PASSWORD)" + - name: FLOWER_PORT + value: "5555" + - name: EMAIL_HOST + value: "mail.midnightthoughts.space" + - name: EMAIL_PORT + value: "465" + - name: EMAIL_HOST_USER + value: "support@midnightthoughts.space" + - name: EMAIL_HOST_PASSWORD + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: EMAIL_HOST_PASSWORD + - name: USE_S3 + value: "false" + - name: AWS_ACCESS_KEY_ID + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_ACCESS_KEY_ID + - name: AWS_SECRET_ACCESS_KEY + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_SECRET_ACCESS_KEY + - name: AWS_STORAGE_BUCKET_NAME + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_STORAGE_BUCKET_NAME + - name: AWS_S3_CUSTOM_DOMAIN + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_S3_CUSTOM_DOMAIN + - name: AWS_S3_ENDPOINT_URL + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_S3_ENDPOINT_URL + - name: ENABLETHUMBNAIL_GENERATION + value: "true" containers: - name: bookwyrm-web image: ghcr.io/mtrnord/bookwyrm:v0.8.2 imagePullPolicy: Always command: ["python"] args: - - "manage.py" - - "runserver" - - "0.0.0.0:8080" + - "manage.py" + - "runserver" + - "0.0.0.0:8080" resources: - requests: - cpu: 200m - memory: 500Mi + requests: + cpu: 200m + memory: 500Mi volumeMounts: - - name: bookwyrm-data - mountPath: /app/static - subPath: static - - name: bookwyrm-data - mountPath: /app/media - subPath: media - - name: bookwyrm-data - mountPath: /app/exports - subPath: exports + - name: bookwyrm-data + mountPath: /app/static + subPath: static + - name: bookwyrm-data + mountPath: /app/media + subPath: media + - name: bookwyrm-data + mountPath: /app/exports + subPath: exports env: + - name: POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: DEBUG + value: "false" + - name: ALLOWED_HOSTS + value: "books.mtrnord.blog,localhost,$(POD_IP)" + - name: SECRET_KEY + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: SECRET_KEY + - name: DOMAIN + value: "books.mtrnord.blog" + - name: USE_HTTPS + value: "true" + - name: PGPORT + value: "5432" + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: POSTGRES_PASSWORD + - name: POSTGRES_USER + value: "bookwyrm" + - name: POSTGRES_DB + value: "bookwyrm" + - name: POSTGRES_HOST + value: "pg-cluster-v2-rw.postgres-cluster.svc.cluster.local" + # TODO: Setup Redis + - name: REDIS_ACTIVITY_URL + value: "redis://bookwyrm-keydb.bookwyrm.svc.cluster.local:6379/0" + - name: REDIS_BROKER_URL + value: "redis://bookwyrm-keydb.bookwyrm.svc.cluster.local:6379/1" + - name: FLOWER_USER + value: "bookwyrm" + - name: FLOWER_PASSWORD + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: FLOWER_PASSWORD + - name: FLOWER_BASIC_AUTH + value: "$(FLOWER_USER):$(FLOWER_PASSWORD)" + - name: FLOWER_PORT + value: "5555" + - name: EMAIL_HOST + value: "mail.midnightthoughts.space" + - name: EMAIL_PORT + value: "465" + - name: EMAIL_HOST_USER + value: "support@midnightthoughts.space" + - name: EMAIL_HOST_PASSWORD + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: EMAIL_HOST_PASSWORD + - name: USE_S3 + value: "false" + - name: AWS_ACCESS_KEY_ID + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_ACCESS_KEY_ID + - name: AWS_SECRET_ACCESS_KEY + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_SECRET_ACCESS_KEY + - name: AWS_STORAGE_BUCKET_NAME + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_STORAGE_BUCKET_NAME + - name: AWS_S3_CUSTOM_DOMAIN + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_S3_CUSTOM_DOMAIN + - name: AWS_S3_ENDPOINT_URL + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_S3_ENDPOINT_URL + - name: ENABLETHUMBNAIL_GENERATION + value: "true" livenessProbe: - httpGet: - port: 8080 - path: "/" - initialDelaySeconds: 15 - periodSeconds: 30 + httpGet: + port: 8080 + path: "/" + initialDelaySeconds: 15 + periodSeconds: 30 ports: - - name: bookwyrm-http - containerPort: 8080 - protocol: TCP + - name: bookwyrm-http + containerPort: 8080 + protocol: TCP - name: bookwyrm-celery-worker image: ghcr.io/mtrnord/bookwyrm:v0.8.2 imagePullPolicy: Always command: ["celery"] args: - - "-A" - - "celerywyrm" - - "worker" - - "-l" - - "info" - - "-Q" - - "high_priority,medium_priority,low_priority,streams,images,suggested_users,email,connectors,lists,inbox,imports,import_triggered,broadcast,misc" + - "-A" + - "celerywyrm" + - "worker" + - "-l" + - "info" + - "-Q" + - "high_priority,medium_priority,low_priority,streams,images,suggested_users,email,connectors,lists,inbox,imports,import_triggered,broadcast,misc" resources: - requests: - cpu: 200m - memory: 200Mi + requests: + cpu: 200m + memory: 200Mi volumeMounts: - - name: bookwyrm-data - mountPath: /app/static - subPath: static - - name: bookwyrm-data - mountPath: /app/media - subPath: media - - name: bookwyrm-data - mountPath: /app/exports - subPath: exports + - name: bookwyrm-data + mountPath: /app/static + subPath: static + - name: bookwyrm-data + mountPath: /app/media + subPath: media + - name: bookwyrm-data + mountPath: /app/exports + subPath: exports env: + - name: POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: DEBUG + value: "false" + - name: ALLOWED_HOSTS + value: "books.mtrnord.blog,localhost,$(POD_IP)" + - name: SECRET_KEY + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: SECRET_KEY + - name: DOMAIN + value: "books.mtrnord.blog" + - name: USE_HTTPS + value: "true" + - name: PGPORT + value: "5432" + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: POSTGRES_PASSWORD + - name: POSTGRES_USER + value: "bookwyrm" + - name: POSTGRES_DB + value: "bookwyrm" + - name: POSTGRES_HOST + value: "pg-cluster-v2-rw.postgres-cluster.svc.cluster.local" + # TODO: Setup Redis + - name: REDIS_ACTIVITY_URL + value: "redis://bookwyrm-keydb.bookwyrm.svc.cluster.local:6379/0" + - name: REDIS_BROKER_URL + value: "redis://bookwyrm-keydb.bookwyrm.svc.cluster.local:6379/1" + - name: FLOWER_USER + value: "bookwyrm" + - name: FLOWER_PASSWORD + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: FLOWER_PASSWORD + - name: FLOWER_BASIC_AUTH + value: "$(FLOWER_USER):$(FLOWER_PASSWORD)" + - name: FLOWER_PORT + value: "5555" + - name: EMAIL_HOST + value: "mail.midnightthoughts.space" + - name: EMAIL_PORT + value: "465" + - name: EMAIL_HOST_USER + value: "support@midnightthoughts.space" + - name: EMAIL_HOST_PASSWORD + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: EMAIL_HOST_PASSWORD + - name: USE_S3 + value: "false" + - name: AWS_ACCESS_KEY_ID + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_ACCESS_KEY_ID + - name: AWS_SECRET_ACCESS_KEY + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_SECRET_ACCESS_KEY + - name: AWS_STORAGE_BUCKET_NAME + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_STORAGE_BUCKET_NAME + - name: AWS_S3_CUSTOM_DOMAIN + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_S3_CUSTOM_DOMAIN + - name: AWS_S3_ENDPOINT_URL + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_S3_ENDPOINT_URL + - name: ENABLETHUMBNAIL_GENERATION + value: "true" - name: bookwyrm-celery-beat image: ghcr.io/mtrnord/bookwyrm:v0.8.2 imagePullPolicy: Always command: ["celery"] args: - - "-A" - - "celerywyrm" - - "beat" - - "-l" - - "INFO" - - "--scheduler" - - "django_celery_beat.schedulers:DatabaseScheduler" + - "-A" + - "celerywyrm" + - "beat" + - "-l" + - "INFO" + - "--scheduler" + - "django_celery_beat.schedulers:DatabaseScheduler" resources: - requests: - cpu: 200m - memory: 200Mi + requests: + cpu: 200m + memory: 200Mi volumeMounts: - - name: bookwyrm-data - mountPath: /app/static - subPath: static - - name: bookwyrm-data - mountPath: /app/media - subPath: media - - name: bookwyrm-data - mountPath: /app/exports - subPath: exports + - name: bookwyrm-data + mountPath: /app/static + subPath: static + - name: bookwyrm-data + mountPath: /app/media + subPath: media + - name: bookwyrm-data + mountPath: /app/exports + subPath: exports env: + - name: POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: DEBUG + value: "false" + - name: ALLOWED_HOSTS + value: "books.mtrnord.blog,localhost,$(POD_IP)" + - name: SECRET_KEY + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: SECRET_KEY + - name: DOMAIN + value: "books.mtrnord.blog" + - name: USE_HTTPS + value: "true" + - name: PGPORT + value: "5432" + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: POSTGRES_PASSWORD + - name: POSTGRES_USER + value: "bookwyrm" + - name: POSTGRES_DB + value: "bookwyrm" + - name: POSTGRES_HOST + value: "pg-cluster-v2-rw.postgres-cluster.svc.cluster.local" + # TODO: Setup Redis + - name: REDIS_ACTIVITY_URL + value: "redis://bookwyrm-keydb.bookwyrm.svc.cluster.local:6379/0" + - name: REDIS_BROKER_URL + value: "redis://bookwyrm-keydb.bookwyrm.svc.cluster.local:6379/1" + - name: FLOWER_USER + value: "bookwyrm" + - name: FLOWER_PASSWORD + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: FLOWER_PASSWORD + - name: FLOWER_BASIC_AUTH + value: "$(FLOWER_USER):$(FLOWER_PASSWORD)" + - name: FLOWER_PORT + value: "5555" + - name: EMAIL_HOST + value: "mail.midnightthoughts.space" + - name: EMAIL_PORT + value: "465" + - name: EMAIL_HOST_USER + value: "support@midnightthoughts.space" + - name: EMAIL_HOST_PASSWORD + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: EMAIL_HOST_PASSWORD + - name: USE_S3 + value: "false" + - name: AWS_ACCESS_KEY_ID + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_ACCESS_KEY_ID + - name: AWS_SECRET_ACCESS_KEY + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_SECRET_ACCESS_KEY + - name: AWS_STORAGE_BUCKET_NAME + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_STORAGE_BUCKET_NAME + - name: AWS_S3_CUSTOM_DOMAIN + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_S3_CUSTOM_DOMAIN + - name: AWS_S3_ENDPOINT_URL + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_S3_ENDPOINT_URL + - name: ENABLETHUMBNAIL_GENERATION + value: "true" - name: bookwyrm-flower image: ghcr.io/mtrnord/bookwyrm:v0.8.2 imagePullPolicy: Always command: ["celery"] args: - - "-A" - - "celerywyrm" - - "flower" - - "--url_prefix=flower" + - "-A" + - "celerywyrm" + - "flower" + - "--url_prefix=flower" resources: - requests: - cpu: 200m - memory: 200Mi + requests: + cpu: 200m + memory: 200Mi volumeMounts: - - name: bookwyrm-data - mountPath: /app/static - subPath: static - - name: bookwyrm-data - mountPath: /app/media - subPath: media - - name: bookwyrm-data - mountPath: /app/exports - subPath: exports + - name: bookwyrm-data + mountPath: /app/static + subPath: static + - name: bookwyrm-data + mountPath: /app/media + subPath: media + - name: bookwyrm-data + mountPath: /app/exports + subPath: exports env: + - name: POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: DEBUG + value: "false" + - name: ALLOWED_HOSTS + value: "books.mtrnord.blog,localhost,$(POD_IP)" + - name: SECRET_KEY + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: SECRET_KEY + - name: DOMAIN + value: "books.mtrnord.blog" + - name: USE_HTTPS + value: "true" + - name: PGPORT + value: "5432" + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: POSTGRES_PASSWORD + - name: POSTGRES_USER + value: "bookwyrm" + - name: POSTGRES_DB + value: "bookwyrm" + - name: POSTGRES_HOST + value: "pg-cluster-v2-rw.postgres-cluster.svc.cluster.local" + # TODO: Setup Redis + - name: REDIS_ACTIVITY_URL + value: "redis://bookwyrm-keydb.bookwyrm.svc.cluster.local:6379/0" + - name: REDIS_BROKER_URL + value: "redis://bookwyrm-keydb.bookwyrm.svc.cluster.local:6379/1" + - name: FLOWER_USER + value: "bookwyrm" + - name: FLOWER_PASSWORD + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: FLOWER_PASSWORD + - name: FLOWER_BASIC_AUTH + value: "$(FLOWER_USER):$(FLOWER_PASSWORD)" + - name: FLOWER_PORT + value: "5555" + - name: EMAIL_HOST + value: "mail.midnightthoughts.space" + - name: EMAIL_PORT + value: "465" + - name: EMAIL_HOST_USER + value: "support@midnightthoughts.space" + - name: EMAIL_HOST_PASSWORD + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: EMAIL_HOST_PASSWORD + - name: USE_S3 + value: "false" + - name: AWS_ACCESS_KEY_ID + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_ACCESS_KEY_ID + - name: AWS_SECRET_ACCESS_KEY + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_SECRET_ACCESS_KEY + - name: AWS_STORAGE_BUCKET_NAME + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_STORAGE_BUCKET_NAME + - name: AWS_S3_CUSTOM_DOMAIN + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_S3_CUSTOM_DOMAIN + - name: AWS_S3_ENDPOINT_URL + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_S3_ENDPOINT_URL + - name: ENABLETHUMBNAIL_GENERATION + value: "true" ports: - - name: flower-http - containerPort: 5555 - protocol: TCP + - name: flower-http + containerPort: 5555 + protocol: TCP --- # Service for BookWyrm apiVersion: v1 @@ -212,12 +641,12 @@ spec: rules: - name: bookwyrm-traffic matches: - - path: - type: PathPrefix - value: / + - path: + type: PathPrefix + value: / backendRefs: - - name: bookwyrm - port: 8080 + - name: bookwyrm + port: 8080 timeouts: - request: 240s - backendRequest: 0s + request: 240s + backendRequest: 0s diff --git a/apps/talos_cluster/bookwyrm/initJob.yaml b/apps/talos_cluster/bookwyrm/initJob.yaml @@ -20,100 +20,100 @@ spec: imagePullPolicy: Always command: ["bash"] args: - - /hl/bookwyrm.sh - - init + - /hl/bookwyrm.sh + - init volumeMounts: - - name: bookwyrm-script - mountPath: /hl - readOnly: true + - name: bookwyrm-script + mountPath: /hl + readOnly: true env: - - name: POD_IP - valueFrom: - fieldRef: - fieldPath: status.podIP - - name: DEBUG - value: "false" - - name: ALLOWED_HOSTS - value: "books.mtrnord.blog,localhost,$(POD_IP)" - - name: SECRET_KEY - valueFrom: - secretKeyRef: - name: bookwyrm-secrets - key: SECRET_KEY - - name: DOMAIN - value: "books.mtrnord.blog" - - name: USE_HTTPS - value: "true" - - name: PGPORT - value: "5432" - - name: POSTGRES_PASSWORD - valueFrom: - secretKeyRef: - name: bookwyrm-secrets - key: POSTGRES_PASSWORD - - name: POSTGRES_USER - value: "bookwyrm" - - name: POSTGRES_DB - value: "bookwyrm" - - name: POSTGRES_HOST - value: "pg-cluster-v2-rw.postgres-cluster.svc.cluster.local" - # TODO: Setup Redis - - name: REDIS_ACTIVITY_URL - value: "redis://bookwyrm-keydb.bookwyrm.svc.cluster.local:6379/0" - - name: REDIS_BROKER_URL - value: "redis://bookwyrm-keydb.bookwyrm.svc.cluster.local:6379/1" - - name: FLOWER_USER - value: "bookwyrm" - - name: FLOWER_PASSWORD - valueFrom: - secretKeyRef: - name: bookwyrm-secrets - key: FLOWER_PASSWORD - - name: FLOWER_BASIC_AUTH - value: "$(FLOWER_USER):$(FLOWER_PASSWORD)" - - name: FLOWER_PORT - value: "5555" - - name: EMAIL_HOST - value: "mail.midnightthoughts.space" - - name: EMAIL_PORT - value: "465" - - name: EMAIL_HOST_USER - value: "support@midnightthoughts.space" - - name: EMAIL_HOST_PASSWORD - valueFrom: - secretKeyRef: - name: bookwyrm-secrets - key: EMAIL_HOST_PASSWORD - - name: USE_S3 - value: "false" - - name: AWS_ACCESS_KEY_ID - valueFrom: - secretKeyRef: - name: bookwyrm-secrets - key: AWS_ACCESS_KEY_ID - - name: AWS_SECRET_ACCESS_KEY - valueFrom: - secretKeyRef: - name: bookwyrm-secrets - key: AWS_SECRET_ACCESS_KEY - - name: AWS_STORAGE_BUCKET_NAME - valueFrom: - secretKeyRef: - name: bookwyrm-secrets - key: AWS_STORAGE_BUCKET_NAME - - name: AWS_S3_CUSTOM_DOMAIN - valueFrom: - secretKeyRef: - name: bookwyrm-secrets - key: AWS_S3_CUSTOM_DOMAIN - - name: AWS_S3_ENDPOINT_URL - valueFrom: - secretKeyRef: - name: bookwyrm-secrets - key: AWS_S3_ENDPOINT_URL - - name: ENABLETHUMBNAIL_GENERATION - value: "true" + - name: POD_IP + valueFrom: + fieldRef: + fieldPath: status.podIP + - name: DEBUG + value: "false" + - name: ALLOWED_HOSTS + value: "books.mtrnord.blog,localhost,$(POD_IP)" + - name: SECRET_KEY + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: SECRET_KEY + - name: DOMAIN + value: "books.mtrnord.blog" + - name: USE_HTTPS + value: "true" + - name: PGPORT + value: "5432" + - name: POSTGRES_PASSWORD + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: POSTGRES_PASSWORD + - name: POSTGRES_USER + value: "bookwyrm" + - name: POSTGRES_DB + value: "bookwyrm" + - name: POSTGRES_HOST + value: "pg-cluster-v2-rw.postgres-cluster.svc.cluster.local" + # TODO: Setup Redis + - name: REDIS_ACTIVITY_URL + value: "redis://bookwyrm-keydb.bookwyrm.svc.cluster.local:6379/0" + - name: REDIS_BROKER_URL + value: "redis://bookwyrm-keydb.bookwyrm.svc.cluster.local:6379/1" + - name: FLOWER_USER + value: "bookwyrm" + - name: FLOWER_PASSWORD + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: FLOWER_PASSWORD + - name: FLOWER_BASIC_AUTH + value: "$(FLOWER_USER):$(FLOWER_PASSWORD)" + - name: FLOWER_PORT + value: "5555" + - name: EMAIL_HOST + value: "mail.midnightthoughts.space" + - name: EMAIL_PORT + value: "465" + - name: EMAIL_HOST_USER + value: "support@midnightthoughts.space" + - name: EMAIL_HOST_PASSWORD + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: EMAIL_HOST_PASSWORD + - name: USE_S3 + value: "false" + - name: AWS_ACCESS_KEY_ID + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_ACCESS_KEY_ID + - name: AWS_SECRET_ACCESS_KEY + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_SECRET_ACCESS_KEY + - name: AWS_STORAGE_BUCKET_NAME + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_STORAGE_BUCKET_NAME + - name: AWS_S3_CUSTOM_DOMAIN + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_S3_CUSTOM_DOMAIN + - name: AWS_S3_ENDPOINT_URL + valueFrom: + secretKeyRef: + name: bookwyrm-secrets + key: AWS_S3_ENDPOINT_URL + - name: ENABLETHUMBNAIL_GENERATION + value: "true" volumes: - name: bookwyrm-script configMap: - name: bookwyrm-script-d4kgf6b8fg + name: bookwyrm-script-d4kgf6b8fg diff --git a/apps/talos_cluster/bookwyrm/keydb.yaml b/apps/talos_cluster/bookwyrm/keydb.yaml @@ -19,12 +19,12 @@ spec: command: ["keydb-server"] args: ["/etc/keydb/keydb.conf", "--protected-mode", "no"] ports: - - containerPort: 6379 + - containerPort: 6379 resources: - requests: - memory: "128Mi" - cpu: "100m" - limits: {} + requests: + memory: "128Mi" + cpu: "100m" + limits: {} tolerations: - key: arch operator: Equal diff --git a/apps/talos_cluster/bookwyrm/kustomization.yaml b/apps/talos_cluster/bookwyrm/kustomization.yaml @@ -9,7 +9,7 @@ configMapGenerator: - name: bookwyrm-script namespace: mailserver files: - - bookwyrm.sh=bookwyrm.sh + - bookwyrm.sh=bookwyrm.sh options: - labels: - app: bookwyrm + labels: + app: bookwyrm diff --git a/apps/talos_cluster/envoy-gateway/gateway_settings.yaml b/apps/talos_cluster/envoy-gateway/gateway_settings.yaml @@ -48,42 +48,42 @@ spec: protocol: TCP port: 25 allowedRoutes: - kinds: - - kind: TCPRoute - namespaces: - from: All + kinds: + - kind: TCPRoute + namespaces: + from: All - name: submissions protocol: TCP port: 465 allowedRoutes: - kinds: - - kind: TCPRoute - namespaces: - from: All + kinds: + - kind: TCPRoute + namespaces: + from: All - name: submission protocol: TCP port: 587 allowedRoutes: - kinds: - - kind: TCPRoute - namespaces: - from: All + kinds: + - kind: TCPRoute + namespaces: + from: All - name: imap protocol: TCP port: 143 allowedRoutes: - kinds: - - kind: TCPRoute - namespaces: - from: All + kinds: + - kind: TCPRoute + namespaces: + from: All - name: imaps protocol: TCP port: 993 allowedRoutes: - kinds: - - kind: TCPRoute - namespaces: - from: All + kinds: + - kind: TCPRoute + namespaces: + from: All --- apiVersion: gateway.networking.k8s.io/v1 kind: Gateway @@ -107,402 +107,402 @@ spec: protocol: TCP port: 22 allowedRoutes: - kinds: - - kind: TCPRoute - namespaces: - from: Selector - selector: - matchLabels: - app: cgit + kinds: + - kind: TCPRoute + namespaces: + from: Selector + selector: + matchLabels: + app: cgit - name: https-talos-midnightthoughts protocol: HTTPS hostname: "talos.midnightthoughts.space" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: talos.midnightthoughts.space-tls + mode: Terminate + certificateRefs: + - kind: Secret + name: talos.midnightthoughts.space-tls - name: https-nordgedanken.dev protocol: HTTPS hostname: "nordgedanken.dev" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: nordgedanken.dev-tls + mode: Terminate + certificateRefs: + - kind: Secret + name: nordgedanken.dev-tls - name: https-openpgpkey.nordgedanken.dev protocol: HTTPS hostname: "openpgpkey.nordgedanken.dev" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: openpgpkey.nordgedanken.dev-tls + mode: Terminate + certificateRefs: + - kind: Secret + name: openpgpkey.nordgedanken.dev-tls - name: https-midnightthoughts-auth protocol: HTTPS hostname: "auth.midnightthoughts.space" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: auth.midnightthoughts.space-tls + mode: Terminate + certificateRefs: + - kind: Secret + name: auth.midnightthoughts.space-tls - name: https-midnightthoughts-grafana protocol: HTTPS hostname: "grafana.midnightthoughts.space" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: grafana.midnightthoughts.space-tls + mode: Terminate + certificateRefs: + - kind: Secret + name: grafana.midnightthoughts.space-tls - name: https-draupnir-midnightthoughts protocol: HTTPS hostname: "draupnir.midnightthoughts.space" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: draupnir.midnightthoughts.space-tls + mode: Terminate + certificateRefs: + - kind: Secret + name: draupnir.midnightthoughts.space-tls - name: https-matrix-draupnir-midnightthoughts protocol: HTTPS hostname: "matrix.draupnir.midnightthoughts.space" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: matrix.draupnir.midnightthoughts.space-tls + mode: Terminate + certificateRefs: + - kind: Secret + name: matrix.draupnir.midnightthoughts.space-tls - name: https-midnightthoughts-vault protocol: HTTPS hostname: "vault.midnightthoughts.space" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: vault.midnightthoughts.space-tls + mode: Terminate + certificateRefs: + - kind: Secret + name: vault.midnightthoughts.space-tls - name: https-midnightthoughts-budget protocol: HTTPS hostname: "budget.midnightthoughts.space" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: budget.midnightthoughts.space-tls + mode: Terminate + certificateRefs: + - kind: Secret + name: budget.midnightthoughts.space-tls - name: https-midnightthoughts-ldap protocol: HTTPS hostname: "ldap.midnightthoughts.space" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: ldap.midnightthoughts.space-tls + mode: Terminate + certificateRefs: + - kind: Secret + name: ldap.midnightthoughts.space-tls - name: ldap protocol: TCP port: 389 allowedRoutes: - kinds: - - kind: TCPRoute - namespaces: - from: Selector - selector: - matchLabels: - app: authentik + kinds: + - kind: TCPRoute + namespaces: + from: Selector + selector: + matchLabels: + app: authentik - name: https-mtrnord-blog-gts protocol: HTTPS hostname: "gts.mtrnord.blog" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: gts.mtrnord.blog-tls + mode: Terminate + certificateRefs: + - kind: Secret + name: gts.mtrnord.blog-tls - name: https-mtrnord-blog-books protocol: HTTPS hostname: "books.mtrnord.blog" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: books.mtrnord.blog-tls + mode: Terminate + certificateRefs: + - kind: Secret + name: books.mtrnord.blog-tls - name: https-midnightthoughts-collabora protocol: HTTPS hostname: "collabora.midnightthoughts.space" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: collabora.midnightthoughts.space + mode: Terminate + certificateRefs: + - kind: Secret + name: collabora.midnightthoughts.space - name: https-midnightthoughts-webhook-kubernetes protocol: HTTPS hostname: "webhook.kubernetes.midnightthoughts.space" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: webhook.kubernetes.midnightthoughts.space-tls + mode: Terminate + certificateRefs: + - kind: Secret + name: webhook.kubernetes.midnightthoughts.space-tls - name: https-api-connectivity-tester-mtrnord-blog protocol: HTTPS hostname: "api.connectivity-tester.mtrnord.blog" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: api.connectivity-tester.mtrnord.blog-tls + mode: Terminate + certificateRefs: + - kind: Secret + name: api.connectivity-tester.mtrnord.blog-tls - name: https-stage-connectivity-tester-mtrnord-blog protocol: HTTPS hostname: "stage.connectivity-tester.mtrnord.blog" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: stage.connectivity-tester.mtrnord.blog-tls + mode: Terminate + certificateRefs: + - kind: Secret + name: stage.connectivity-tester.mtrnord.blog-tls - name: https-connectivity-tester-mtrnord-blog protocol: HTTPS hostname: "connectivity-tester.mtrnord.blog" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: connectivity-tester.mtrnord.blog-tls + mode: Terminate + certificateRefs: + - kind: Secret + name: connectivity-tester.mtrnord.blog-tls - name: https-beta-connectivity-tester-mtrnord-blog protocol: HTTPS hostname: "beta.connectivity-tester.mtrnord.blog" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: beta.connectivity-tester.mtrnord.blog-tls + mode: Terminate + certificateRefs: + - kind: Secret + name: beta.connectivity-tester.mtrnord.blog-tls - name: https-federationtester-mtrnord-blog protocol: HTTPS hostname: "federationtester.mtrnord.blog" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: federationtester.mtrnord.blog-tls + mode: Terminate + certificateRefs: + - kind: Secret + name: federationtester.mtrnord.blog-tls - name: https-mtrnord-blog-root protocol: HTTPS hostname: "mtrnord.blog" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: mtrnord.blog-tls + mode: Terminate + certificateRefs: + - kind: Secret + name: mtrnord.blog-tls - name: https-mtrnord-blog-matrix protocol: HTTPS hostname: "matrix.mtrnord.blog" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: matrix.mtrnord.blog-tls + mode: Terminate + certificateRefs: + - kind: Secret + name: matrix.mtrnord.blog-tls - name: https-rss-mtrnord-blog protocol: HTTPS hostname: "rss.mtrnord.blog" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: rss.mtrnord.blog-tls + mode: Terminate + certificateRefs: + - kind: Secret + name: rss.mtrnord.blog-tls - name: https-notify-mtrnord-blog protocol: HTTPS hostname: "notify.mtrnord.blog" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: notify.mtrnord.blog-tls + mode: Terminate + certificateRefs: + - kind: Secret + name: notify.mtrnord.blog-tls - name: https-midnightthoughts-rspamd protocol: HTTPS hostname: "rspamd.midnightthoughts.space" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: rspamd.midnightthoughts.space-tls + mode: Terminate + certificateRefs: + - kind: Secret + name: rspamd.midnightthoughts.space-tls - name: https-midnightthoughts-plane protocol: HTTPS hostname: "plane.midnightthoughts.space" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: plane.midnightthoughts.space + mode: Terminate + certificateRefs: + - kind: Secret + name: plane.midnightthoughts.space - name: https-midnightthoughts-kimai protocol: HTTPS hostname: "kimai.midnightthoughts.space" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: kimai.midnightthoughts.space + mode: Terminate + certificateRefs: + - kind: Secret + name: kimai.midnightthoughts.space - name: https-midnightthoughts-morg-statistics protocol: HTTPS hostname: "morg-statistics.midnightthoughts.space" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: morg-statistics.midnightthoughts.space + mode: Terminate + certificateRefs: + - kind: Secret + name: morg-statistics.midnightthoughts.space - name: https-midnightthoughts-mta-sts protocol: HTTPS hostname: "mta-sts.midnightthoughts.space" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: mta-sts.midnightthoughts.space + mode: Terminate + certificateRefs: + - kind: Secret + name: mta-sts.midnightthoughts.space - name: https-midnightthoughts-lists protocol: HTTPS hostname: "lists.midnightthoughts.space" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: lists.midnightthoughts.space + mode: Terminate + certificateRefs: + - kind: Secret + name: lists.midnightthoughts.space - name: https-midnightthoughts-git protocol: HTTPS hostname: "git.midnightthoughts.space" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: git.midnightthoughts.space + mode: Terminate + certificateRefs: + - kind: Secret + name: git.midnightthoughts.space - name: https-midnightthoughts-plausible protocol: HTTPS hostname: "plausible.midnightthoughts.space" port: 443 allowedRoutes: - namespaces: - from: "All" + namespaces: + from: "All" tls: - mode: Terminate - certificateRefs: - - kind: Secret - name: plausible.midnightthoughts.space + mode: Terminate + certificateRefs: + - kind: Secret + name: plausible.midnightthoughts.space - name: http protocol: HTTP port: 80 allowedRoutes: - namespaces: - from: "Same" + namespaces: + from: "Same" --- apiVersion: gateway.networking.k8s.io/v1 kind: HTTPRoute @@ -515,10 +515,10 @@ spec: sectionName: http rules: - filters: - - type: RequestRedirect - requestRedirect: - scheme: https - statusCode: 301 + - type: RequestRedirect + requestRedirect: + scheme: https + statusCode: 301 --- apiVersion: gateway.envoyproxy.io/v1alpha1 kind: ClientTrafficPolicy diff --git a/infrastructure_talos/configs/cnpg-cluster.yaml b/infrastructure_talos/configs/cnpg-cluster.yaml @@ -112,7 +112,7 @@ spec: - name: barman-cloud.cloudnative-pg.io isWALArchiver: true parameters: - barmanObjectName: hetzner-base-backup + barmanObjectName: hetzner-base-backup managed: roles: - name: freshrss @@ -120,134 +120,134 @@ spec: login: true superuser: false passwordSecret: - name: freshrss + name: freshrss - name: meowlnir ensure: present login: true comment: Read Only Access for synapse required but RW to meowlnir db superuser: false passwordSecret: - name: meowlnir + name: meowlnir - name: connectivity-tester-stage ensure: present login: true superuser: false passwordSecret: - name: connectivity-tester-stage + name: connectivity-tester-stage - name: connectivity-tester ensure: present login: true superuser: false passwordSecret: - name: connectivity-tester + name: connectivity-tester - name: draupnir_synapse ensure: present login: true superuser: false passwordSecret: - name: draupnir-synapse + name: draupnir-synapse - name: authentik ensure: present login: true superuser: false passwordSecret: - name: authentik + name: authentik - name: ejabberd ensure: present login: true superuser: false passwordSecret: - name: ejabberd + name: ejabberd - name: vaultwarden ensure: present login: true superuser: false passwordSecret: - name: vaultwarden + name: vaultwarden - name: mastodon ensure: present login: true superuser: false passwordSecret: - name: mastodon + name: mastodon - name: openproject ensure: present login: true superuser: false passwordSecret: - name: openproject + name: openproject - name: plausible ensure: present login: true superuser: false passwordSecret: - name: plausible + name: plausible - name: coder ensure: present login: true superuser: false passwordSecret: - name: coder + name: coder - name: matrix_auth ensure: present login: true superuser: false passwordSecret: - name: matrix-auth + name: matrix-auth - name: cachet ensure: present login: true superuser: false passwordSecret: - name: cachet + name: cachet - name: docuseal ensure: present login: true superuser: false passwordSecret: - name: docuseal + name: docuseal - name: bugzilla ensure: present login: true superuser: false passwordSecret: - name: bugzilla + name: bugzilla - name: rundeck ensure: present login: true superuser: false passwordSecret: - name: rundeck + name: rundeck - name: plane ensure: present login: true superuser: false passwordSecret: - name: plane + name: plane - name: gotosocial ensure: present login: true superuser: false passwordSecret: - name: gotosocial + name: gotosocial - name: grafana-ro ensure: present login: true superuser: false passwordSecret: - name: grafana-ro + name: grafana-ro - name: mailman ensure: present login: true superuser: false passwordSecret: - name: mailman + name: mailman - name: bookwyrm ensure: present login: true superuser: false passwordSecret: - name: bookwyrm + name: bookwyrm storage: storageClass: hcloud-volumes size: 15Gi diff --git a/infrastructure_talos/controllers/cert-manager.yaml b/infrastructure_talos/controllers/cert-manager.yaml @@ -20,7 +20,6 @@ metadata: spec: interval: 24h url: https://zachomedia.github.io/cert-manager-webhook-pdns - --- apiVersion: image.toolkit.fluxcd.io/v1 kind: ImageRepository @@ -126,8 +125,8 @@ spec: acme.cert-manager.io/http01-solver: "true" ingress: - ports: - - protocol: TCP - port: 8089 + - protocol: TCP + port: 8089 policyTypes: - Ingress ---