You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
c4k-website/src/main/cljc/dda/c4k_gitea/core.cljc

30 lines
1.5 KiB
Clojure

(ns dda.c4k-website.core
(:require
[dda.c4k-common.yaml :as yaml]
[dda.c4k-common.common :as cm]
[dda.c4k-website.website :as website]
[dda.c4k-common.postgres :as postgres]))
(defn k8s-objects [config]
(let [storage-class (if (contains? config :postgres-data-volume-path) :manual :local-path)]
(cm/concat-vec
(map yaml/to-string
(filter #(not (nil? %))
[(postgres/generate-config {:postgres-size :2gb :db-name "website"})
(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 5
:pvc-storage-class-name storage-class})
(postgres/generate-deployment {:postgres-image "postgres:14"
:postgres-size :2gb})
(postgres/generate-service)
(website/generate-deployment)
(website/generate-service)
(website/generate-service-ssh)
(website/generate-data-volume config)
(website/generate-appini-env config)
(website/generate-secrets config)
(website/generate-ingress config)
(website/generate-certificate config)])))))