Rewrite nextcloud to use DSL impl
This commit is contained in:
@@ -2,7 +2,7 @@
|
|||||||
(:require
|
(:require
|
||||||
["@pulumi/pulumi" :as pulumi]
|
["@pulumi/pulumi" :as pulumi]
|
||||||
[utils.vault :as vault-utils]
|
[utils.vault :as vault-utils]
|
||||||
[utils.ingress :as ingress-utils]))
|
[utils.k8s :as k8s-utils]))
|
||||||
|
|
||||||
(defn- add-skip-await-transformation
|
(defn- add-skip-await-transformation
|
||||||
"A Pulumi transformation that adds the skipAwait annotation to problematic resources."
|
"A Pulumi transformation that adds the skipAwait annotation to problematic resources."
|
||||||
@@ -22,26 +22,20 @@
|
|||||||
(defn deploy-nextcloud
|
(defn deploy-nextcloud
|
||||||
"Deploy Nextcloud using direct vault connection info."
|
"Deploy Nextcloud using direct vault connection info."
|
||||||
[provider vault-provider]
|
[provider vault-provider]
|
||||||
(let [{:keys [helm-v3 secrets yaml-values service-name namespace bind-secrets]} (vault-utils/prepare vault-provider "nextcloud" provider true)
|
(let [nextcloud-values-transformer (fn [{:keys [base-values hostname app-name]}]
|
||||||
hostname (.. secrets -host)
|
(-> base-values
|
||||||
final-helm-values (-> yaml-values
|
|
||||||
(assoc-in [:ingress :enabled] false)
|
(assoc-in [:ingress :enabled] false)
|
||||||
(assoc-in [:nextcloud :host] hostname)
|
(assoc-in [:nextcloud :host] hostname)
|
||||||
(assoc-in [:nextcloud :trusted_domains] [hostname "nextcloud"]))
|
(assoc-in [:nextcloud :trusted_domains] [hostname app-name])))
|
||||||
chart (new (.. helm-v3 -Chart)
|
stack (k8s-utils/deploy-stack
|
||||||
service-name
|
:namespace :vault-secrets :hostname :chart :ingress
|
||||||
(clj->js {:chart service-name
|
{:provider provider
|
||||||
:fetchOpts {:repo "https://nextcloud.github.io/helm/"}
|
:vault-provider vault-provider
|
||||||
:namespace namespace
|
:app-namespace "nextcloud"
|
||||||
:values final-helm-values})
|
:app-name "nextcloud"
|
||||||
(clj->js {:provider provider
|
:image-port 8080
|
||||||
:dependsOn [bind-secrets]
|
:vault-load-yaml true
|
||||||
:transformations [add-skip-await-transformation]
|
:chart-repo "https://nextcloud.github.io/helm/"
|
||||||
}))
|
:helm-values-fn nextcloud-values-transformer
|
||||||
ingress (ingress-utils/create-ingress hostname namespace service-name 8080 chart)
|
:transformations add-skip-await-transformation})]
|
||||||
]
|
{:stack stack}))
|
||||||
{:namespace namespace
|
|
||||||
:nextcloud-secrets bind-secrets
|
|
||||||
:chart chart
|
|
||||||
:ingress ingress
|
|
||||||
:nextcloud-url (str "https://" hostname)}))
|
|
||||||
Reference in New Issue
Block a user