fix postgres size et al.

merge-requests/1/merge
ansgarz 2 years ago
parent 303ad09088
commit f73d57c0c7

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

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

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

Loading…
Cancel
Save