@provisioner/jitsi
Version:
CodeZero provisioner for Jitsi
60 lines • 2.43 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.createApplyMixin = void 0;
const common_1 = require("@provisioner/common");
const buffer_1 = require("buffer");
exports.createApplyMixin = (base) => class extends base {
get jitsiPods() {
return {
kind: 'Pod',
metadata: {
namespace: this.serviceNamespace,
labels: {
app: 'jitsi'
}
}
};
}
async createApply() {
await this.installJitsi();
await this.ensureJitsiIsRunning();
}
async installJitsi() {
const namespace = this.serviceNamespace;
const secret = buffer_1.Buffer.from(common_1.generatePassword()).toString('base64');
const authPassword = buffer_1.Buffer.from(common_1.generatePassword()).toString('base64');
const jvbPassword = buffer_1.Buffer.from(common_1.generatePassword()).toString('base64');
const clusterIP = await super.getIngressGatewayServiceClusterIp();
const tag = this.spec.tag || 'stable-5142';
await this.controller.cluster
.begin('Install jitsi deployment')
.addOwner(this.controller.resource)
.upsertFile('../../k8s/latest/1-secret.yaml', { namespace, secret, authPassword, jvbPassword })
.end();
await this.controller.cluster
.begin('Install NodePort')
.addOwner(this.controller.resource)
.upsertFile('../../k8s/latest/2-deployment.yaml', { namespace, clusterIP, tag })
.end();
await this.controller.cluster
.begin('Install Virtual Service')
.addOwner(this.controller.resource)
.upsertFile('../../k8s/latest/3-webservice.yaml', { namespace })
.end();
await this.controller.cluster
.begin('Install Virtual Service')
.addOwner(this.controller.resource)
.upsertFile('../../k8s/latest/4-service.yaml', { namespace })
.end();
}
async ensureJitsiIsRunning() {
await this.controller.cluster.
begin('Ensure jitsi services are running')
.beginWatch(this.jitsiPods)
.whenWatch(({ condition }) => condition.Ready === 'True', (processor) => {
processor.endWatch();
})
.end();
}
};
//# sourceMappingURL=createApply.js.map