use common-monitoring

This commit is contained in:
jerger 2022-12-27 08:50:48 +01:00
parent 214aa41c28
commit 19e580188e
8 changed files with 34 additions and 12 deletions

View file

@ -45,7 +45,7 @@ output "ipv4" {
## k8s minicluster ## k8s minicluster
For k8s installation we use our [dda-k8s-crate](https://github.com/DomainDrivenArchitecture/dda-k8s-crate) with the following configuation: For k8s installation we use our [provs](https://repo.prod.meissa.de/meissa/provs) with the following configuation:
``` ```
@ -69,5 +69,5 @@ with the following config.edn:
``` ```
{:fqdn "the-fqdn-from aws_route53_record.v4_neu" {:fqdn "the-fqdn-from aws_route53_record.v4_neu"
:postgres-data-volume-path "/var/postgres" ;; Volume was configured at dda-k8s-crate, results in a PersistentVolume definition. :postgres-data-volume-path "/var/postgres" ;; Volume was configured at dda-k8s-crate, results in a PersistentVolume definition.
:issuer :prod } :issuer "prod" }
``` ```

View file

@ -2,7 +2,7 @@
"name": "c4k-jitsi", "name": "c4k-jitsi",
"description": "Generate c4k yaml for a jitsi deployment.", "description": "Generate c4k yaml for a jitsi deployment.",
"author": "meissa GmbH", "author": "meissa GmbH",
"version": "1.2.3-SNAPSHOT", "version": "1.3.0-SNAPSHOT",
"homepage": "https://gitlab.com/domaindrivenarchitecture/c4k-jitsi#readme", "homepage": "https://gitlab.com/domaindrivenarchitecture/c4k-jitsi#readme",
"repository": "https://www.npmjs.com/package/c4k-jitsi", "repository": "https://www.npmjs.com/package/c4k-jitsi",
"license": "APACHE2", "license": "APACHE2",

View file

@ -1,4 +1,4 @@
(defproject org.domaindrivenarchitecture/c4k-jitsi "1.2.3-SNAPSHOT" (defproject org.domaindrivenarchitecture/c4k-jitsi "1.3.0-SNAPSHOT"
:description "jitsi c4k-installation package" :description "jitsi c4k-installation package"
:url "https://domaindrivenarchitecture.org" :url "https://domaindrivenarchitecture.org"
:license {:name "Apache License, Version 2.0" :license {:name "Apache License, Version 2.0"

View file

@ -4,7 +4,7 @@
"src/test/cljc" "src/test/cljc"
"src/test/cljs" "src/test/cljs"
"src/test/resources"] "src/test/resources"]
:dependencies [[org.domaindrivenarchitecture/c4k-common-cljs "3.3.0"] :dependencies [[org.domaindrivenarchitecture/c4k-common-cljs "4.0.0-SNAPSHOT"]
[hickory "0.7.1"]] [hickory "0.7.1"]]
:builds {:frontend {:target :browser :builds {:frontend {:target :browser
:modules {:main {:init-fn dda.c4k-jitsi.browser/init}} :modules {:main {:init-fn dda.c4k-jitsi.browser/init}}

View file

@ -8,8 +8,8 @@
(defn -main [& cmd-args] (defn -main [& cmd-args]
(uberjar/main-common (uberjar/main-common
"c4k-jitsi" "c4k-jitsi"
jitsi/config? core/config?
jitsi/auth? core/auth?
core/config-defaults core/config-defaults
core/k8s-objects core/k8s-objects
cmd-args)) cmd-args))

View file

@ -1,16 +1,31 @@
(ns dda.c4k-jitsi.core (ns dda.c4k-jitsi.core
(:require (:require
[clojure.string :as cs]
[clojure.spec.alpha :as s] [clojure.spec.alpha :as s]
#?(:clj [orchestra.core :refer [defn-spec]] #?(:clj [orchestra.core :refer [defn-spec]]
:cljs [orchestra.core :refer-macros [defn-spec]]) :cljs [orchestra.core :refer-macros [defn-spec]])
[dda.c4k-common.common :as cm] [dda.c4k-common.common :as cm]
[dda.c4k-common.predicate :as cp]
[dda.c4k-common.monitoring :as mon]
[dda.c4k-common.yaml :as yaml] [dda.c4k-common.yaml :as yaml]
[dda.c4k-jitsi.jitsi :as jitsi])) [dda.c4k-jitsi.jitsi :as jitsi]))
(def config-defaults {:issuer "staging"}) (def config-defaults {:issuer "staging"})
(defn k8s-objects [config auth] (s/def ::mon-cfg mon/config?)
(s/def ::mon-auth mon/auth?)
(def config? (s/keys :req-un [::jitsi/fqdn]
:opt-un [::jitsi/issuer
::mon-cfg]))
(def auth? (s/keys :req-un [::jitsi/jvb-auth-password
::jitsi/jicofo-auth-password
::jitsi/jicofo-component-secret]
:opt-un [::mon-auth]))
(defn-spec k8s-objects cp/map-or-seq?
[config config?
auth auth?]
(map yaml/to-string (map yaml/to-string
(filter (filter
#(not (nil? %)) #(not (nil? %))
@ -21,4 +36,6 @@
(jitsi/generate-etherpad-service) (jitsi/generate-etherpad-service)
(jitsi/generate-deployment config)] (jitsi/generate-deployment config)]
(jitsi/generate-ingress-web config) (jitsi/generate-ingress-web config)
(jitsi/generate-ingress-etherpad config))))) (jitsi/generate-ingress-etherpad config)
(when (:contains? config :mon-cfg)
(mon/generate (:mon-cfg config) (:mon-auth auth)))))))

View file

@ -1,3 +1,5 @@
{:jvb-auth-password "JvbAuth" {:jvb-auth-password "JvbAuth"
:jicofo-auth-password "JicofoAuth" :jicofo-auth-password "JicofoAuth"
:jicofo-component-secret "JicofoCompSec"} :jicofo-component-secret "JicofoCompSec"
:mon-auth {:grafana-cloud-user "user"
:grafana-cloud-password "password"}}

View file

@ -1,2 +1,5 @@
{:fqdn "jitsi.test.meissa-gmbh.de" {:fqdn "jitsi.test.meissa-gmbh.de"
:issuer :staging} :issuer "staging"
:mon-cfg {:grafana-cloud-url "url-for-your-prom-remote-write-endpoint"
:k3s-cluster-name "jitsi"
:k3s-cluster-stage "test"}}