Skip to content

Commit 278ac77

Browse files
authored
Merge pull request #584 from kubero-dev/528-add-clickouse-add-on
add clickhouse addon
2 parents 143130f + e8cd164 commit 278ac77

File tree

6 files changed

+190
-1
lines changed

6 files changed

+190
-1
lines changed

README.md

+2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ Kubero is Kubernetes native and runs with two containers on any Kubernetes insta
5959
| <img src="client/public/img/addons/pgsql.svg" width="30px" style="vertical-align: middle; margin: 10px"> | Crunchy Postgres Cluster | [Crunchy Data](https://artifacthub.io/packages/olm/community-operators/postgresql) | |
6060
| <img src="client/public/img/addons/redis.svg" width="30px" style="vertical-align: middle; margin: 10px"> | Redis Cluster | [Opstree](https://artifacthub.io/packages/olm/community-operators/redis-operator) | |
6161
| <img src="client/public/img/addons/CockroachDB.svg" width="30px" style="vertical-align: middle; margin: 10px"> | CockroachDB | [CockroachDB](https://artifacthub.io/packages/olm/community-operators/cockroachdb) | |
62+
| <img src="client/public/img/addons/clickhouse.svg" width="30px" style="vertical-align: middle; margin: 10px"> | Clickhouse | [Altinity ](https://artifacthub.io/packages/olm/community-operators/clickhouse) | |
63+
6264

6365

6466
\* Ships with the Kubero Operator
+1
Loading

server/src/addons/clickhouse.ts

+181
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
import {Plugin, IPlugin, IPluginFormFields} from './plugin';
2+
3+
// Classname must be same as the CRD's Name
4+
export class ClickHouseInstallation extends Plugin implements IPlugin {
5+
public id: string = 'clickhouse-operator';//same as operator name
6+
public displayName = 'ClickHouse Cluster'
7+
public icon = '/img/addons/clickhouse.svg'
8+
public install = 'curl -s https://raw.githubusercontent.com/Altinity/clickhouse-operator/master/deploy/operator-web-installer/clickhouse-operator-install.sh | OPERATOR_NAMESPACE=clickhouse-operator-system bash'
9+
public url = 'https://github.com/Altinity/clickhouse-operator/'
10+
public description: string = 'ClickHouse is an open source column-oriented database management system capable of real time generation of analytical data reports. Check ClickHouse documentation for more complete details.'
11+
public links = [
12+
{
13+
name: 'Altinity', url: 'https://altinity.com/',
14+
},
15+
{
16+
name: 'Operator homepage', url: 'https://www.altinity.com/kubernetes-operator'
17+
},
18+
{
19+
name: 'Documentation', url: 'https://github.com/Altinity/clickhouse-operator/tree/master/docs'
20+
}
21+
]
22+
public maintainers = [
23+
{
24+
name: 'Altinity',
25+
26+
url: 'https://altinity.com',
27+
github: 'altinity'
28+
}
29+
]
30+
public artifact_url = 'https://artifacthub.io/api/v1/packages/olm/community-operators/clickhouse'
31+
public beta: boolean = true;
32+
33+
public formfields: {[key: string]: IPluginFormFields} = {
34+
'ClickHouseInstallation.metadata.name':{
35+
type: 'text',
36+
label: 'Name *',
37+
name: 'metadata.name',
38+
required: true,
39+
default: 'clickhouse',
40+
description: 'The name of the Clickhouse instance'
41+
},
42+
'ClickHouseInstallation.spec.configuration.clusters[0].layout.shardsCount':{
43+
type: 'number',
44+
label: 'Shards Count *',
45+
name: 'spec.configuration.clusters[0].layout.shardsCount',
46+
default: 1,
47+
required: true,
48+
description: 'Number of shards'
49+
},
50+
'ClickHouseInstallation.spec.configuration.clusters[0].layout.replicasCount':{
51+
type: 'number',
52+
label: 'Replicas Count *',
53+
name: 'spec.configuration.clusters[0].layout.replicasCount',
54+
default: 1,
55+
required: true,
56+
description: 'Number of replicas'
57+
},
58+
"ClickHouseInstallation.spec.configuration.users['admin/password']":{
59+
type: 'text',
60+
label: 'Admin Password *',
61+
name: "ClickHouseInstallation.spec.configuration.users['admin/password']",
62+
default: 'ChangeMe',
63+
required: true,
64+
description: 'Password for user "user"'
65+
},
66+
"ClickHouseInstallation.spec.configuration.users['admin/networks/ip'][0]":{
67+
type: 'text',
68+
label: 'Admin Access Network *',
69+
name: "ClickHouseInstallation.spec.configuration.users['admin/networks/ip'][0]",
70+
default: '0.0.0.0/0',
71+
required: true,
72+
description: 'Allowed Network access for "admin"'
73+
},
74+
"ClickHouseInstallation.spec.configuration.users['user/password']":{
75+
type: 'text',
76+
label: 'User Password *',
77+
name: "ClickHouseInstallation.spec.configuration.users['user/password']",
78+
default: 'ChangeMe',
79+
required: true,
80+
description: 'Password for user "user"'
81+
},
82+
"ClickHouseInstallation.spec.configuration.users['user/networks/ip'][0]":{
83+
type: 'text',
84+
label: 'User Access Network *',
85+
name: "ClickHouseInstallation.spec.configuration.users['user/networks/ip'][0]",
86+
default: '0.0.0.0/0',
87+
required: true,
88+
description: 'Allowed Network access for "user"'
89+
},
90+
'ClickHouseInstallation.spec.templates.volumeClaimTemplates[0].spec.resources.requests.storage':{
91+
type: 'text',
92+
label: 'Data Storage Size*',
93+
name: 'ClickHouseInstallation.spec.templates.volumeClaimTemplates[0].spec.resources.requests.storage',
94+
default: '1Gi',
95+
required: true,
96+
description: 'Size of the data storage'
97+
},
98+
'ClickHouseInstallation.spec.templates.volumeClaimTemplates[1].spec.resources.requests.storage':{
99+
type: 'text',
100+
label: 'Log Storage Size*',
101+
name: 'ClickHouseInstallation.spec.templates.volumeClaimTemplates[0].spec.resources.requests.storage',
102+
default: '1Gi',
103+
required: true,
104+
description: 'Size of the log storage'
105+
},
106+
};
107+
108+
public env: any[] = []
109+
110+
protected additionalResourceDefinitions: Object = {}
111+
112+
constructor(availableOperators: any) {
113+
super();
114+
super.init(availableOperators);
115+
}
116+
117+
public resourceDefinitions: any = {
118+
ClickHouseInstallation: {
119+
apiVersion: "clickhouse.altinity.com/v1",
120+
kind: "ClickHouseInstallation",
121+
metadata: {
122+
name: "example"
123+
},
124+
spec: {
125+
configuration: {
126+
users: {
127+
'user/password': "user_password",
128+
'user/networks/ip': [
129+
"0.0.0.0/0"
130+
],
131+
'admin/password': "admin_password",
132+
'admin/networks/ip': [
133+
"0.0.0.0/0"
134+
]
135+
},
136+
clusters: [
137+
{
138+
name: "example",
139+
layout: {
140+
shardsCount: 1,
141+
replicasCount: 2
142+
}
143+
}
144+
]
145+
},
146+
templates: {
147+
volumeClaimTemplates: [
148+
{
149+
name: "data-volume-template",
150+
spec: {
151+
accessModes: [
152+
"ReadWriteOnce"
153+
],
154+
resources: {
155+
requests: {
156+
storage: "1Gi"
157+
}
158+
}
159+
}
160+
},
161+
{
162+
name: "log-volume-template",
163+
spec: {
164+
accessModes: [
165+
"ReadWriteOnce"
166+
],
167+
resources: {
168+
requests: {
169+
storage: "100Mi"
170+
}
171+
}
172+
}
173+
}
174+
]
175+
}
176+
}
177+
}
178+
}
179+
180+
}
181+

server/src/addons/cockroachDB.ts

+1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export class Cockroachdb extends Plugin implements IPlugin {
66
public displayName = 'CockroachDB'
77
public icon = '/img/addons/CockroachDB.svg'
88
public install: string = 'kubectl create -f https://operatorhub.io/install/cockroachdb.yaml'
9+
public install_olm: string = 'kubectl create -f https://operatorhub.io/install/cockroachdb.yaml'
910
public url = 'https://artifacthub.io/packages/olm/community-operators/cockroachdb'
1011
public docs = [
1112
{

server/src/addons/plugin.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ export abstract class Plugin {
158158

159159
private loadOperatorData(availableOperators: any): any {
160160
for (const operatorCRD of availableOperators) {
161-
// console.log(operatorCRD.spec.names.kind, this.constructor.name) // debug CRD
161+
console.log(operatorCRD.spec.names.kind, this.constructor.name) // debug CRD
162162
if (operatorCRD.spec.names.kind === this.constructor.name) {
163163
this.enabled = true;
164164
this.version.installed = operatorCRD.spec.version

server/src/modules/addons.ts

+4
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ import { KuberoKafka } from '../addons/kuberoKafka';
1717
import { KuberoMail } from '../addons/kuberoMail';
1818
import { KuberoRabbitMQ } from '../addons/kuberoRabbitMQ';
1919
import { Cockroachdb } from '../addons/cockroachDB';
20+
import { ClickHouseInstallation } from '../addons/clickhouse';
2021
import { MongoDB } from '../addons/mongoDB';
2122
import { Tenant } from '../addons/minio';
2223
import { Tunnel } from '../addons/cloudflare';
@@ -133,6 +134,9 @@ export class Addons {
133134

134135
const minio = new Tenant(this.CRDList)
135136
this.addonsList.push(minio)
137+
138+
const clickhouse = new ClickHouseInstallation(this.CRDList)
139+
this.addonsList.push(clickhouse)
136140
}
137141

138142
public async getAddonsList(): Promise<IPlugin[]> {

0 commit comments

Comments
 (0)