added postgres

main
see 2 years ago
parent 8c0bf1243e
commit 3b6570e6fb

@ -5,7 +5,7 @@
:url "https://www.apache.org/licenses/LICENSE-2.0.html"}
:dependencies [[org.clojure/clojure "1.10.3"]
[org.clojure/tools.reader "1.3.6"]
[org.domaindrivenarchitecture/c4k-common-clj "0.4.0"]
[org.domaindrivenarchitecture/c4k-common-clj "1.0.0"]
[hickory "0.7.1"]]
:target-path "target/%s/"
:source-paths ["src/main/cljc"

@ -11,14 +11,21 @@
(def config-defaults {:issuer :staging})
(def config? (s/keys :req-un [::matomo/fqdn]
:opt-un []))
:opt-un [::matomo/issuer ::postgres/postgres-data-volume-path]))
(def auth? (s/keys :req-un []))
(def auth? (s/keys :req-un [::postgres/postgres-db-user ::postgres/postgres-db-password])) ;TODO add auth
(defn k8s-objects [config]
(into
[]
(concat
(concat
[(yaml/to-string (postgres/generate-config :postgres-size :2gb :db-name "shynet"))
(yaml/to-string (postgres/generate-secret config))]
(when (contains? config :postgres-data-volume-path)
[(yaml/to-string (postgres/generate-persistent-volume config))])
[(yaml/to-string (postgres/generate-pvc))
(yaml/to-string (postgres/generate-deployment :postgres-image "postgres:14"))
(yaml/to-string (postgres/generate-service))]
[(yaml/to-string (matomo/generate-webserver-deployment))
(yaml/to-string (matomo/generate-celeryworker-deployment))
(yaml/to-string (matomo/generate-ingress config))

@ -3,11 +3,11 @@
[clojure.spec.alpha :as s]
#?(:cljs [shadow.resource :as rc])
[dda.c4k-common.yaml :as yaml]
[dda.c4k-common.common :as cm]))
[dda.c4k-common.common :as cm]
[dda.c4k-common.predicate :as pred]))
(s/def ::fqdn cm/fqdn-string?)
(s/def ::issuer cm/letsencrypt-issuer?)
(s/def ::matomo-data-volume-path string?)
(s/def ::fqdn pred/fqdn-string?)
(s/def ::issuer pred/letsencrypt-issuer?)
#?(:cljs
(defmethod yaml/load-resource :matomo [resource-name]

@ -0,0 +1,2 @@
{:postgres-db-user "jira"
:postgres-db-password "jira-db-password"}

@ -0,0 +1,3 @@
{:fqdn "shynet-test.test.meissa-gmbh.de"
:issuer :staging
:postgres-data-volume-path "/var/postgres"}
Loading…
Cancel
Save