Properly set up DB for discord bridge
This commit is contained in:
@@ -1,38 +1,37 @@
|
|||||||
(ns k8s.services.matrix.mautrix-discord.database.service)
|
(ns k8s.services.matrix.mautrix-discord.database.service)
|
||||||
|
|
||||||
(def config
|
(def config
|
||||||
{:stack [:vault:prepare :k8s:pvc :k8s:config-map :k8s:deployment :k8s:service]
|
{:stack [:vault:prepare :k8s:pvc :k8s:deployment :k8s:service]
|
||||||
:app-namespace "matrix"
|
:app-namespace "matrix"
|
||||||
:app-name "mautrix-discord"
|
:app-name "mautrix-discord-db"
|
||||||
:image-port 29334
|
|
||||||
|
|
||||||
:k8s:config-map-opts
|
|
||||||
{:metadata {:name "discord-bridge-config"}
|
|
||||||
:data {"config.yaml" "YAML-HERE" ;;TODO
|
|
||||||
"registration.yaml" "YAML-HERE"}}
|
|
||||||
|
|
||||||
:k8s:pvc-opts
|
:k8s:pvc-opts
|
||||||
{"discord-bridge-data" {:storageClass "juicefs-sc"
|
{:metadata {:name "mautrix-discord-pg-data"
|
||||||
:accessModes ["ReadWriteMany"]
|
:namespace "matrix"}
|
||||||
:storage "1Gi"}}
|
:spec {:storageClassName "hcloud-volumes"
|
||||||
|
:accessModes ["ReadWriteOnce"]
|
||||||
|
:resources {:requests {:storage "10Gi"}}}}
|
||||||
|
|
||||||
:k8s:deployment-opts
|
:k8s:deployment-opts
|
||||||
{:spec
|
{:spec
|
||||||
{:template
|
{:template
|
||||||
{:spec
|
{:metadata
|
||||||
|
{:annotations
|
||||||
|
{"backup.velero.io/backup-volumes" "db"}}
|
||||||
|
:spec
|
||||||
{:containers
|
{:containers
|
||||||
[{:name 'app-name
|
[{:name 'app-name
|
||||||
:image "dock.mau.dev/mautrix/discord:latest"
|
:image "postgres:14-alpine"
|
||||||
:args ["/usr/bin/mautrix-discord" "-c" "/data/config.yaml" "-r" "/data/registration.yaml"]
|
:ports [{:containerPort 5432}]
|
||||||
|
:env [{:name "PGDATA" :value "/var/lib/postgresql/data/pgdata"}
|
||||||
:volumeMounts [{:name "data" :mountPath "/data"}
|
{:name "POSTGRES_USER" :value 'username}
|
||||||
{:name "config" :mountPath "/data/config.yaml" :subPath "config.yaml"}
|
{:name "POSTGRES_PASSWORD" :value 'password}
|
||||||
{:name "config" :mountPath "/data/registration.yaml" :subPath "registration.yaml"}]}]
|
{:name "POSTGRES_DB" :value 'db-name}]
|
||||||
|
:volumeMounts [{:name "db" :mountPath "/var/lib/postgresql/data"}]}]
|
||||||
|
|
||||||
:volumes
|
:volumes
|
||||||
[{:name "data" :persistentVolumeClaim {:claimName "discord-bridge-data"}}
|
[{:name "db" :persistentVolumeClaim {:claimName "mautrix-discord-pg-data"}}]}}}}
|
||||||
{:name "config" :configMap {:name "discord-bridge-config"}}]}}}}
|
|
||||||
|
|
||||||
:k8s:service-opts
|
:k8s:service-opts
|
||||||
{:spec {:selector {:app 'app-name}
|
{:spec {:selector {:app 'app-name}
|
||||||
:ports [{:port 29334 :targetPort 29334}]}}})
|
:ports [{:name 'app-name :port 5432 :targetPort 5432}]}}})
|
||||||
Reference in New Issue
Block a user