merge-requests/4/merge
jerger 2 years ago
parent 8b8a39ceb3
commit 3a2f587709

@ -4,8 +4,8 @@
:license {:name "Apache License, Version 2.0" :license {:name "Apache License, Version 2.0"
:url "https://www.apache.org/licenses/LICENSE-2.0.html"} :url "https://www.apache.org/licenses/LICENSE-2.0.html"}
:dependencies [[org.clojure/clojure "1.10.3"] :dependencies [[org.clojure/clojure "1.10.3"]
[org.clojure/tools.reader "1.3.4"] [org.clojure/tools.reader "1.3.6"]
[org.domaindrivenarchitecture/c4k-common-clj "1.0.0"]] [org.domaindrivenarchitecture/c4k-common-clj "1.1.0"]]
:target-path "target/%s/" :target-path "target/%s/"
:source-paths ["src/main/cljc" :source-paths ["src/main/cljc"
"src/main/clj"] "src/main/clj"]

@ -25,19 +25,21 @@
(defn-spec k8s-objects any? (defn-spec k8s-objects any?
[config (s/merge config? auth?)] [config (s/merge config? auth?)]
(let [storage-class (if (contains? config :postgres-data-volume-path) :manual :local-path)]
(into (into
[] []
(concat [(yaml/to-string (postgres/generate-config {:postgres-size :8gb})) (concat [(yaml/to-string (postgres/generate-config {:postgres-size :8gb}))
(yaml/to-string (postgres/generate-secret config))] (yaml/to-string (postgres/generate-secret config))]
(when (contains? config :postgres-data-volume-path) (when (contains? config :postgres-data-volume-path)
[(yaml/to-string (postgres/generate-persistent-volume config))]) [(yaml/to-string (postgres/generate-persistent-volume config))])
[(yaml/to-string (postgres/generate-pvc)) [(yaml/to-string (postgres/generate-pvc {:pv-storage-size-gb 50
:pvc-storage-class-name storage-class}))
(yaml/to-string (postgres/generate-deployment)) (yaml/to-string (postgres/generate-deployment))
(yaml/to-string (postgres/generate-service))] (yaml/to-string (postgres/generate-service))]
(when (contains? config :nextcloud-data-volume-path) (when (contains? config :nextcloud-data-volume-path)
[(yaml/to-string (nextcloud/generate-persistent-volume config))]) [(yaml/to-string (nextcloud/generate-persistent-volume config))])
[(yaml/to-string (nextcloud/generate-secret config)) [(yaml/to-string (nextcloud/generate-secret config))
(yaml/to-string (nextcloud/generate-pvc)) (yaml/to-string (nextcloud/generate-pvc config))
(yaml/to-string (nextcloud/generate-deployment config)) (yaml/to-string (nextcloud/generate-deployment config))
(yaml/to-string (nextcloud/generate-service)) (yaml/to-string (nextcloud/generate-service))
(yaml/to-string (nextcloud/generate-certificate config)) (yaml/to-string (nextcloud/generate-certificate config))
@ -46,7 +48,7 @@
[(yaml/to-string (backup/generate-config config)) [(yaml/to-string (backup/generate-config config))
(yaml/to-string (backup/generate-secret config)) (yaml/to-string (backup/generate-secret config))
(yaml/to-string (backup/generate-cron)) (yaml/to-string (backup/generate-cron))
(yaml/to-string (backup/generate-backup-restore-deployment config))])))) (yaml/to-string (backup/generate-backup-restore-deployment config))])))))
(defn-spec generate any? (defn-spec generate any?
[my-config config? [my-config config?

@ -58,6 +58,7 @@
))) )))
(defn generate-pvc [] (defn generate-pvc []
(let [{:keys [nextcloud-data-volume-path storage-size]} config])
(yaml/from-string (yaml/load-resource "nextcloud/pvc.yaml"))) (yaml/from-string (yaml/load-resource "nextcloud/pvc.yaml")))
(defn generate-service [] (defn generate-service []

Loading…
Cancel
Save