added basic generate methods in core
This commit is contained in:
parent
3ec97d7d40
commit
8d46290e55
1 changed files with 32 additions and 42 deletions
|
@ -26,52 +26,42 @@
|
||||||
"jitsi/web-service.yaml" (rc/inline "jitsi/web-service.yaml")
|
"jitsi/web-service.yaml" (rc/inline "jitsi/web-service.yaml")
|
||||||
(throw (js/Error. "Undefined Resource!")))))
|
(throw (js/Error. "Undefined Resource!")))))
|
||||||
|
|
||||||
(defn generate-secret [config]
|
(defn generate-jicofo-deployment [config]
|
||||||
(let [{:keys [fqdn django-secret-key postgres-db-user postgres-db-password]} config]
|
(->
|
||||||
(->
|
(yaml/from-string (yaml/load-resource "jitsi/jicofo-deployment.yaml"))))
|
||||||
(yaml/from-string (yaml/load-resource "jitsi/secret.yaml"))
|
|
||||||
; See comment in secret.yaml
|
|
||||||
;(assoc-in [:stringData :ALLOWED_HOSTS] fqdn)
|
|
||||||
(assoc-in [:stringData :DJANGO_SECRET_KEY] django-secret-key)
|
|
||||||
(assoc-in [:stringData :DB_USER] postgres-db-user)
|
|
||||||
(assoc-in [:stringData :DB_PASSWORD] postgres-db-password))))
|
|
||||||
|
|
||||||
(defn generate-certificate [config]
|
(defn generate-jicofo-pvc []
|
||||||
(let [{:keys [fqdn issuer]} config
|
(yaml/from-string (yaml/load-resource "jitsi/jicofo-pvc.yaml")))
|
||||||
letsencrypt-issuer (str "letsencrypt-" (name issuer) "-issuer")]
|
|
||||||
(->
|
|
||||||
(yaml/from-string (yaml/load-resource "jitsi/certificate.yaml"))
|
|
||||||
(assoc-in [:spec :commonName] fqdn)
|
|
||||||
(assoc-in [:spec :dnsNames] [fqdn])
|
|
||||||
(assoc-in [:spec :issuerRef :name] letsencrypt-issuer))))
|
|
||||||
|
|
||||||
(defn generate-webserver-deployment []
|
(defn generate-jvb-deployment [config]
|
||||||
(let [jitsi-application "jitsi-webserver"]
|
(->
|
||||||
(-> (yaml/from-string (yaml/load-resource "jitsi/deployments.yaml"))
|
(yaml/from-string (yaml/load-resource "jitsi/jvb-deployment.yaml"))))
|
||||||
(cm/replace-all-matching-values-by-new-value "jitsi-application" jitsi-application)
|
|
||||||
(update-in [:spec :template :spec :containers 0] dissoc :command))))
|
|
||||||
|
|
||||||
(defn generate-celeryworker-deployment []
|
(defn generate-jvb-pvc []
|
||||||
(let [jitsi-application "jitsi-celeryworker"]
|
(yaml/from-string (yaml/load-resource "jitsi/jvb-pvc.yaml")))
|
||||||
(-> (yaml/from-string (yaml/load-resource "jitsi/deployments.yaml"))
|
|
||||||
(cm/replace-all-matching-values-by-new-value "jitsi-application" jitsi-application))))
|
|
||||||
|
|
||||||
(defn generate-ingress [config]
|
(defn generate-jvb-service []
|
||||||
(let [{:keys [fqdn issuer ingress-type]
|
(yaml/from-string (yaml/load-resource "jitsi/jvb-service.yaml")))
|
||||||
:or {issuer :staging ingress-type :default}} config
|
|
||||||
letsencrypt-issuer (str "letsencrypt-" (name issuer) "-issuer")
|
|
||||||
ingress-kind (if (= :default ingress-type) "" (name ingress-type))]
|
|
||||||
(->
|
|
||||||
(yaml/from-string (yaml/load-resource "jitsi/ingress.yaml"))
|
|
||||||
(assoc-in [:metadata :annotations :cert-manager.io/cluster-issuer] letsencrypt-issuer)
|
|
||||||
(assoc-in [:metadata :annotations :kubernetes.io/ingress.class] ingress-kind)
|
|
||||||
(cm/replace-all-matching-values-by-new-value "fqdn" fqdn))))
|
|
||||||
|
|
||||||
(defn generate-statefulset []
|
(defn generate-networkpolicy []
|
||||||
(yaml/from-string (yaml/load-resource "jitsi/statefulset.yaml")))
|
(yaml/from-string (yaml/load-resource "jitsi/networkpolicy.yaml")))
|
||||||
|
|
||||||
(defn generate-service-redis []
|
(defn generate-prosody-deployment [config]
|
||||||
(yaml/from-string (yaml/load-resource "jitsi/service-redis.yaml")))
|
(->
|
||||||
|
(yaml/from-string (yaml/load-resource "jitsi/prosody-deployment.yaml"))))
|
||||||
|
|
||||||
(defn generate-service-webserver []
|
(defn generate-prosody-pvc []
|
||||||
(yaml/from-string (yaml/load-resource "jitsi/service-webserver.yaml")))
|
(yaml/from-string (yaml/load-resource "jitsi/prosody-pvc.yaml")))
|
||||||
|
|
||||||
|
(defn generate-prosody-service []
|
||||||
|
(yaml/from-string (yaml/load-resource "jitsi/prosody-service.yaml")))
|
||||||
|
|
||||||
|
(defn generate-web-deployment [config]
|
||||||
|
(->
|
||||||
|
(yaml/from-string (yaml/load-resource "jitsi/web-deployment.yaml"))))
|
||||||
|
|
||||||
|
(defn generate-web-pvc []
|
||||||
|
(yaml/from-string (yaml/load-resource "jitsi/web-pvc.yaml")))
|
||||||
|
|
||||||
|
(defn generate-web-service []
|
||||||
|
(yaml/from-string (yaml/load-resource "jitsi/web-service.yaml")))
|
||||||
|
|
Loading…
Reference in a new issue