fix postgres size et al.

This commit is contained in:
ansgarz 2022-06-08 19:56:44 +02:00
parent 303ad09088
commit f73d57c0c7
3 changed files with 9 additions and 15 deletions

View file

@ -17,17 +17,17 @@
(let [storage-class (if (contains? config :postgres-data-volume-path) :manual :local-path)]
(cm/concat-vec
[(yaml/load-resource "gitea/volumes.yaml")
(yaml/load-resource "gitea/services.yaml")]
(yaml/load-resource "gitea/services.yaml")
(yaml/load-resource "gitea/appini-configmap.yaml")]
(map yaml/to-string
[(postgres/generate-config {:postgres-size :2gb :db-name "gitea"})
(postgres/generate-secret config)
(when (contains? config :postgres-data-volume-path)
(postgres/generate-persistent-volume (select-keys config [:postgres-data-volume-path :pv-storage-size-gb])))
(postgres/generate-pvc {:pv-storage-size-gb 20
(postgres/generate-pvc {:pv-storage-size-gb 10
:pvc-storage-class-name storage-class})
(postgres/generate-deployment {:postgres-image "postgres:14"
:postgres-size :2gb})
(postgres/generate-service)
(gitea/generate-appini-configmap)
(gitea/generate-deployment config)
(gitea/generate-ingress config)]))))

View file

@ -13,7 +13,7 @@
#?(:cljs
(defmethod yaml/load-resource :gitea [resource-name]
(case resource-name
"gitea/secret.yaml" (rc/inline "gitea/secret.yaml")
; todo "gitea/secret.yaml" (rc/inline "gitea/secret.yaml")
"gitea/certificate.yaml" (rc/inline "gitea/certificate.yaml")
"gitea/deployments.yaml" (rc/inline "gitea/deployments.yaml")
"gitea/ingress.yaml" (rc/inline "gitea/ingress.yaml")
@ -26,9 +26,6 @@
(defmethod yaml/load-as-edn :gitea [resource-name]
(yaml/from-string (yaml/load-resource resource-name))))
(defn generate-appini-configmap []
(yaml/load-as-edn "gitea/appini-configmap.yaml"))
(defn generate-deployment [config]
(let [{:keys [postgres-db-user postgres-db-password]} config]
(->
@ -44,6 +41,3 @@
(yaml/load-as-edn "gitea/ingress.yaml")
(assoc-in [:metadata :annotations :cert-manager.io/cluster-issuer] letsencrypt-issuer)
(cm/replace-all-matching-values-by-new-value "FQDN" fqdn))))
(defn generate-volumes []
(yaml/load-as-edn "gitea/volumes.yaml"))

View file

@ -5,7 +5,7 @@ metadata:
namespace: default
data:
app.ini: |
APP_NAME = Gitea AZ2
APP_NAME = Gitea meissa
RUN_MODE = prod
RUN_USER = git
@ -29,7 +29,7 @@ data:
SSH_LISTEN_PORT = 22
LFS_START_SERVER = true
LFS_CONTENT_PATH = /data/git/lfs
LFS_JWT_SECRET = 6x-yxhPA88_9SagCcu1b7E5SSZmeQOX_K32IUDdjknU
;LFS_JWT_SECRET =
OFFLINE_MODE = false
[database]
@ -70,8 +70,8 @@ data:
[security]
INSTALL_LOCK = true
SECRET_KEY = UrTkoOE4Rw2BnMhqRSO7VqyCEYpmnI5YVDAnj0D0VSxEm1jiRSrUkJePj6al5j5D
INTERNAL_TOKEN = eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJuYmYiOjE2NTM0MTEyMjB9.kUwwf2sNwOr0fJwUvXr57Krhj2OudhTmDEQCCchbnUo
;SECRET_KEY =
;INTERNAL_TOKEN =
[service]
DISABLE_REGISTRATION = true
@ -86,7 +86,7 @@ data:
NO_REPLY_ADDRESS = noreply.localhost
[oauth2]
JWT_SECRET = ZZWsXFEj1QpRO9LGGE8Z8XF46G_0LxlbQFUkacXvQjo
;JWT_SECRET =
[mailer]
ENABLED = false