|
|
|
@ -25,28 +25,30 @@
|
|
|
|
|
|
|
|
|
|
(defn-spec k8s-objects any?
|
|
|
|
|
[config (s/merge config? auth?)]
|
|
|
|
|
(into
|
|
|
|
|
[]
|
|
|
|
|
(concat [(yaml/to-string (postgres/generate-config {:postgres-size :8gb}))
|
|
|
|
|
(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))
|
|
|
|
|
(yaml/to-string (postgres/generate-service))]
|
|
|
|
|
(when (contains? config :nextcloud-data-volume-path)
|
|
|
|
|
[(yaml/to-string (nextcloud/generate-persistent-volume config))])
|
|
|
|
|
[(yaml/to-string (nextcloud/generate-secret config))
|
|
|
|
|
(yaml/to-string (nextcloud/generate-pvc))
|
|
|
|
|
(yaml/to-string (nextcloud/generate-deployment config))
|
|
|
|
|
(yaml/to-string (nextcloud/generate-service))
|
|
|
|
|
(yaml/to-string (nextcloud/generate-certificate config))
|
|
|
|
|
(yaml/to-string (nextcloud/generate-ingress config))]
|
|
|
|
|
(when (contains? config :restic-repository)
|
|
|
|
|
[(yaml/to-string (backup/generate-config config))
|
|
|
|
|
(yaml/to-string (backup/generate-secret config))
|
|
|
|
|
(yaml/to-string (backup/generate-cron))
|
|
|
|
|
(yaml/to-string (backup/generate-backup-restore-deployment config))]))))
|
|
|
|
|
(let [storage-class (if (contains? config :postgres-data-volume-path) :manual :local-path)]
|
|
|
|
|
(into
|
|
|
|
|
[]
|
|
|
|
|
(concat [(yaml/to-string (postgres/generate-config {:postgres-size :8gb}))
|
|
|
|
|
(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 {:pv-storage-size-gb 50
|
|
|
|
|
:pvc-storage-class-name storage-class}))
|
|
|
|
|
(yaml/to-string (postgres/generate-deployment))
|
|
|
|
|
(yaml/to-string (postgres/generate-service))]
|
|
|
|
|
(when (contains? config :nextcloud-data-volume-path)
|
|
|
|
|
[(yaml/to-string (nextcloud/generate-persistent-volume config))])
|
|
|
|
|
[(yaml/to-string (nextcloud/generate-secret config))
|
|
|
|
|
(yaml/to-string (nextcloud/generate-pvc config))
|
|
|
|
|
(yaml/to-string (nextcloud/generate-deployment config))
|
|
|
|
|
(yaml/to-string (nextcloud/generate-service))
|
|
|
|
|
(yaml/to-string (nextcloud/generate-certificate config))
|
|
|
|
|
(yaml/to-string (nextcloud/generate-ingress config))]
|
|
|
|
|
(when (contains? config :restic-repository)
|
|
|
|
|
[(yaml/to-string (backup/generate-config config))
|
|
|
|
|
(yaml/to-string (backup/generate-secret config))
|
|
|
|
|
(yaml/to-string (backup/generate-cron))
|
|
|
|
|
(yaml/to-string (backup/generate-backup-restore-deployment config))])))))
|
|
|
|
|
|
|
|
|
|
(defn-spec generate any?
|
|
|
|
|
[my-config config?
|
|
|
|
|