add namespace to jvb-service

This commit is contained in:
Michael Jerger 2024-08-02 15:35:22 +02:00
parent 0f5821f692
commit 0e47be31c6
3 changed files with 28 additions and 2 deletions

View file

@ -76,8 +76,12 @@
(cm/replace-key-value :JICOFO_AUTH_PASSWORD (b64/encode jicofo-auth-password))
(cm/replace-key-value :JICOFO_COMPONENT_SECRET (b64/encode jicofo-component-secret)))))
(defn-spec generate-jvb-service cp/map-or-seq? []
(yaml/from-string (yaml/load-resource "jitsi/jvb-service.yaml")))
(defn-spec generate-jvb-service cp/map-or-seq?
[config config?]
(let [{:keys [namespace]} config]
(->
(yaml/from-string (yaml/load-resource "jitsi/jvb-service.yaml"))
(cm/replace-all-matching "NAMESPACE" namespace))))
(defn-spec generate-web-service cp/map-or-seq? []
(yaml/load-as-edn "jitsi/web-service.yaml"))

View file

@ -7,6 +7,7 @@ metadata:
metallb.universe.tf/allow-shared-ip: "shared-ip-service-group"
metallb.universe.tf/address-pool: public
name: jvb-udp
namespace: NAMESPACE
spec:
type: LoadBalancer
ports:

View file

@ -7,6 +7,8 @@
(st/instrument `cut/generate-deployment)
(st/instrument `cut/generate-secret-jitsi)
(st/instrument `cut/generate-ingress-web)
(st/instrument `cut/generate-jvb-service)
(deftest should-generate-deployment
(is (= {:apiVersion "apps/v1",
@ -147,3 +149,22 @@
(cut/generate-ingress-web
{:fqdn "xy.xy.xy"
:namespace "jitsi"}))))
(deftest should-generate-jvb-service
(is (= {:apiVersion "v1",
:kind "Service",
:metadata
{:labels {:service "jvb"},
:annotations
#:metallb.universe.tf{:allow-shared-ip "shared-ip-service-group",
:address-pool "public"},
:name "jvb-udp"
:namespace "jitsi"},
:spec
{:type "LoadBalancer",
:ports
[{:port 30300, :protocol "UDP", :targetPort 30300, :nodePort 30300}],
:selector {:app "jitsi"}}}
(cut/generate-jvb-service
{:fqdn "xy.xy.xy"
:namespace "jitsi"}))))