-
Notifications
You must be signed in to change notification settings - Fork 197
Expand file tree
/
Copy pathaddons.service.ts
More file actions
131 lines (100 loc) · 4.91 KB
/
addons.service.ts
File metadata and controls
131 lines (100 loc) · 4.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
import { Injectable } from '@nestjs/common';
import { IPlugin } from './plugins/plugin.interface';
import { KuberoMysql } from './plugins/kuberoMysql';
import { KuberoRedis } from './plugins/kuberoRedis';
import { KuberoPostgresql } from './plugins/kuberoPostgresql';
import { KuberoMongoDB } from './plugins/kuberoMongoDB';
import { KuberoMemcached } from './plugins/kuberoMemcached';
import { KuberoElasticsearch } from './plugins/kuberoElasticsearch';
import { KuberoCouchDB } from './plugins/kuberoCouchDB';
import { KuberoKafka } from './plugins/kuberoKafka';
import { KuberoMail } from './plugins/kuberoMail';
import { KuberoRabbitMQ } from './plugins/kuberoRabbitMQ';
import { Tunnel } from './plugins/cloudflare';
import { PostgresCluster } from './plugins/postgresCluster';
import { RedisCluster } from './plugins/redisCluster';
import { Redis } from './plugins/redis';
import { PerconaServerMongoDB as MongoDB } from './plugins/mongoDB';
import { Cockroachdb } from './plugins/cockroachDB';
import { Tenant } from './plugins/minio';
import { ClickHouseInstallation } from './plugins/clickhouse';
import { KubernetesService } from '../kubernetes/kubernetes.service';
import { KuberoAddonPostgres } from './plugins/kuberoaddonsPostgres';
import { KuberoAddonMysql } from './plugins/kuberoaddonsMysql';
import { KuberoAddonRedis } from './plugins/kuberoaddonsRedis';
import { KuberoAddonRabbitmq } from './plugins/kuberoaddonsRabbitmq';
import { KuberoAddonMongodb } from './plugins/kuberoaddonsMongodb';
import { KuberoAddonMemcached } from './plugins/kuberoaddonsMemcached';
import { Cluster as CloudnativePG } from './plugins/cloudnativePG';
import { Elasticsearch } from './plugins/elasticsearch';
@Injectable()
export class AddonsService {
private operatorsAvailable: string[] = [];
public addonsList: IPlugin[] = []; // List or possibly installed operators
private CRDList: any; //List of installed CRDs from kubectl
constructor(private kubectl: KubernetesService) {
this.loadOperators();
}
public async loadOperators(): Promise<void> {
// Load all Custom Resource Definitions to get the list of installed operators
this.CRDList = await this.kubectl.getCustomresources();
const kuberoAddonPostgres = new KuberoAddonPostgres(this.CRDList);
this.addonsList.push(kuberoAddonPostgres);
const kuberoAddonRedis = new KuberoAddonRedis(this.CRDList);
this.addonsList.push(kuberoAddonRedis);
const kuberoAddonMysql = new KuberoAddonMysql(this.CRDList);
this.addonsList.push(kuberoAddonMysql);
const kuberoAddonMemcached = new KuberoAddonMemcached(this.CRDList);
this.addonsList.push(kuberoAddonMemcached);
const kuberoAddonMongodb = new KuberoAddonMongodb(this.CRDList);
this.addonsList.push(kuberoAddonMongodb);
const kuberoCouchDB = new KuberoCouchDB(this.CRDList);
this.addonsList.push(kuberoCouchDB);
const kuberoMail = new KuberoMail(this.CRDList);
this.addonsList.push(kuberoMail);
const kuberoAddonRabbitMQ = new KuberoAddonRabbitmq(this.CRDList);
this.addonsList.push(kuberoAddonRabbitMQ);
const tunnel = new Tunnel(this.CRDList);
this.addonsList.push(tunnel);
const cloudnativePG = new CloudnativePG(this.CRDList);
this.addonsList.push(cloudnativePG);
const postgresCluster = new PostgresCluster(this.CRDList);
this.addonsList.push(postgresCluster);
const redisCluster = new RedisCluster(this.CRDList);
this.addonsList.push(redisCluster);
const redis = new Redis(this.CRDList);
this.addonsList.push(redis);
const elasticsearch = new Elasticsearch(this.CRDList);
this.addonsList.push(elasticsearch);
const mongoDB = new MongoDB(this.CRDList);
this.addonsList.push(mongoDB);
const cockroachdb = new Cockroachdb(this.CRDList);
this.addonsList.push(cockroachdb);
const minio = new Tenant(this.CRDList);
this.addonsList.push(minio);
const clickhouse = new ClickHouseInstallation(this.CRDList);
this.addonsList.push(clickhouse);
const kuberoMysql = new KuberoMysql(this.CRDList);
this.addonsList.push(kuberoMysql);
const kuberoRedis = new KuberoRedis(this.CRDList);
this.addonsList.push(kuberoRedis);
const kuberoKafka = new KuberoKafka(this.CRDList);
this.addonsList.push(kuberoKafka);
const kuberoMemcached = new KuberoMemcached(this.CRDList);
this.addonsList.push(kuberoMemcached);
const kuberoElasticsearch = new KuberoElasticsearch(this.CRDList);
this.addonsList.push(kuberoElasticsearch);
const kuberoMongoDB = new KuberoMongoDB(this.CRDList);
this.addonsList.push(kuberoMongoDB);
const kuberoPostgresql = new KuberoPostgresql(this.CRDList);
this.addonsList.push(kuberoPostgresql);
const kuberoRabbitMQ = new KuberoRabbitMQ(this.CRDList);
this.addonsList.push(kuberoRabbitMQ);
}
public async getAddonsList(): Promise<IPlugin[]> {
return this.addonsList;
}
public getOperatorsList(): string[] {
return this.operatorsAvailable;
}
}