diff --git a/src/main/cljc/dda/c4k_jitsi/jitsi.cljc b/src/main/cljc/dda/c4k_jitsi/jitsi.cljc index f7b72ce..342ce61 100644 --- a/src/main/cljc/dda/c4k_jitsi/jitsi.cljc +++ b/src/main/cljc/dda/c4k_jitsi/jitsi.cljc @@ -150,5 +150,20 @@ (cm/replace-all-matching "NAMESPACE" namespace)) (-> (yaml/load-as-edn "jitsi/prosody-default-cm.yaml") + (cm/replace-all-matching "NAMESPACE" namespace)) + (-> + (yaml/load-as-edn "jitsi/prosody-envs-cm.yaml") + (cm/replace-all-matching "NAMESPACE" namespace)) + (-> + (yaml/load-as-edn "jitsi/prosody-init-cm.yaml") + (cm/replace-all-matching "NAMESPACE" namespace)) + (-> + (yaml/load-as-edn "jitsi/prosody-stateful-set.yaml") + (cm/replace-all-matching "NAMESPACE" namespace)) + (-> + (yaml/load-as-edn "jitsi/prosody-service.yaml") + (cm/replace-all-matching "NAMESPACE" namespace)) + (-> + (yaml/load-as-edn "jitsi/prosody-test-deployment.yaml") (cm/replace-all-matching "NAMESPACE" namespace))])) diff --git a/src/main/resources/jitsi/prosody-service.yaml b/src/main/resources/jitsi/prosody-service.yaml new file mode 100644 index 0000000..8d186bb --- /dev/null +++ b/src/main/resources/jitsi/prosody-service.yaml @@ -0,0 +1,27 @@ +apiVersion: v1 +kind: Service +metadata: + name: prosody + namespace: NAMESPACE + labels: + app.kubernetes.io/name: prosody +spec: + type: ClusterIP + ports: + - port: 5280 + protocol: TCP + name: tcp-bosh-insecure + - port: 5281 + protocol: TCP + name: tcp-bosh-secure + - port: 5347 + protocol: TCP + name: tcp-xmpp-component + - port: 5222 + protocol: TCP + name: tcp-xmpp-c2 + - port: 5269 + protocol: TCP + name: tcp-xmpp-s2 + selector: + app.kubernetes.io/name: prosody \ No newline at end of file diff --git a/src/main/resources/jitsi/prosody-stateful-set.yaml b/src/main/resources/jitsi/prosody-stateful-set.yaml new file mode 100644 index 0000000..fd57147 --- /dev/null +++ b/src/main/resources/jitsi/prosody-stateful-set.yaml @@ -0,0 +1,106 @@ +apiVersion: apps/v1 +kind: StatefulSet +metadata: + name: prosody + namespace: NAMESPACE + labels: + app.kubernetes.io/name: prosody +spec: + serviceName: "prosody" + replicas: 1 + selector: + matchLabels: + app.kubernetes.io/name: prosody + template: + metadata: + labels: + app.kubernetes.io/name: prosody + spec: + serviceAccountName: prosody + securityContext: + {} + containers: + - name: prosody + securityContext: + {} + image: "jitsi/prosody:stable-9909" + imagePullPolicy: IfNotPresent + envFrom: + - configMapRef: + name: prosody + - secretRef: + name: prosody + - secretRef: + name: 'prosody-jibri' + - secretRef: + name: 'prosody-jicofo' + - secretRef: + name: 'prosody-jigasi' + - secretRef: + name: 'prosody-jvb' + - configMapRef: + name: 'prosody-common' + ports: + - name: xmpp-c2s + containerPort: 5222 + protocol: TCP + - name: xmpp-s2s + containerPort: 5269 + protocol: TCP + - name: xmpp-component + containerPort: 5347 + protocol: TCP + - name: bosh-insecure + containerPort: 5280 + protocol: TCP + - name: bosh-secure + containerPort: 5281 + protocol: TCP + livenessProbe: + httpGet: + path: /http-bind + port: bosh-insecure + readinessProbe: + httpGet: + path: /http-bind + port: bosh-insecure + resources: + {} + volumeMounts: + - name: config + mountPath: /config + - name: prosody-data + mountPath: /config/data + volumes: + - name: config + emptyDir: {} + - name: custom-cont-inits + configMap: + defaultMode: 493 + name: prosody-cont-inits + items: + - key: 10-config + path: 10-config + - name: custom-defaults + configMap: + name: prosody-defaults + items: + - key: prosody.cfg.lua + path: prosody.cfg.lua + - key: saslauthd.conf + path: saslauthd.conf + - key: jitsi-meet.cfg.lua + path: jitsi-meet.cfg.lua + - name: prosody-data + persistentVolumeClaim: + claimName: prosody-data + volumeClaimTemplates: + - metadata: + name: prosody-data + spec: + accessModes: + - ReadWriteOnce + volumeMode: Filesystem + resources: + requests: + storage: 3G \ No newline at end of file diff --git a/src/main/resources/jitsi/prosody-test-deployment.yaml b/src/main/resources/jitsi/prosody-test-deployment.yaml new file mode 100644 index 0000000..55993ce --- /dev/null +++ b/src/main/resources/jitsi/prosody-test-deployment.yaml @@ -0,0 +1,24 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: "prosody-test-connection" + namespace: NAMESPACE + labels: + app.kubernetes.io/name: "prosody-test-connection" +spec: + replicas: 0 + strategy: + type: Recreate + selector: + matchLabels: + app.kubernetes.io/name: "prosody-test-connection" + template: + metadata: + labels: + app.kubernetes.io/name: "prosody-test-connection" + spec: + containers: + - name: wget + image: busybox + command: ['wget'] + args: ['prosody:5280/http-bind'] \ No newline at end of file diff --git a/src/test/cljc/dda/c4k_jitsi/jitsi_test.cljc b/src/test/cljc/dda/c4k_jitsi/jitsi_test.cljc index a900ae1..27ba072 100644 --- a/src/test/cljc/dda/c4k_jitsi/jitsi_test.cljc +++ b/src/test/cljc/dda/c4k_jitsi/jitsi_test.cljc @@ -334,7 +334,7 @@ (second (cut/prosody {:fqdn "xy.xy.xy" :namespace "jitsi"})))) - (is (= 5 + (is (= 8 (count (cut/prosody {:fqdn "xy.xy.xy" :namespace "jitsi"}))))) \ No newline at end of file