-
Notifications
You must be signed in to change notification settings - Fork 134
/
Copy pathkuberoMysql.ts
103 lines (97 loc) · 3.54 KB
/
kuberoMysql.ts
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
import {Plugin, IPlugin, IPluginFormFields} from './plugin';
// Classname must be same as the CRD's Name
export class KuberoMysql extends Plugin implements IPlugin {
public id: string = 'kubero-operator';//same as operator name
public displayName = 'MySQL'
public icon = '/img/addons/mysql.svg'
public install: string = ''
public url = 'https://artifacthub.io/packages/olm/community-operators/kubero-operator'
public docs = [
{
title: 'Kubero Docs', url: ''
}
]
public artifact_url = 'https://artifacthub.io/api/v1/packages/olm/kubero/kubero-operator'
public beta: boolean = false;
public formfields: {[key: string]: IPluginFormFields} = {
'KuberoMysql.metadata.name':{
type: 'text',
label: 'MySQL DB Name',
name: 'metadata.name',
required: true,
default: 'mysql',
description: 'The name of the MySQL instance'
},
'KuberoMysql.spec.mysql.image.tag':{
type: 'combobox',
label: 'Version/Tag',
options: ['8.0.33-debian-11-r12', '8.1', '8.2-debian-11', '8.4.4', '9.0', 'latest'], // TODO - load this dynamically
name: 'spec.mysql.image.tag',
required: true,
default: '8.4.4',
description: 'Version of the PostgreSQL image to use'
},
'KuberoMysql.spec.mysql.global.storageClass':{
type: 'select-storageclass',
label: 'Storage Class',
// options: ['default', 'local-path', 'nfs-client', 'rook-ceph-block'],
name: 'spec.mysql.global.storageClass',
default: 'standard',
required: true
},
'KuberoMysql.spec.mysql.primary.persistence.size':{
type: 'text',
label: 'Sorage Size*',
name: 'spec.mysql.primary.persistence.size',
default: '1Gi',
required: true,
description: 'Size of the storage'
},
'KuberoMysql.spec.mysql.auth.createDatabase':{
type: 'switch',
label: 'Create a Database*',
name: 'spec.mysql.auth.createDatabase',
default: false,
required: false,
description: 'Create a database on MySQL startup'
},
'KuberoMysql.spec.mysql.auth.database':{
type: 'text',
label: 'Database Name*',
name: 'spec.mysql.auth.database',
default: '',
required: true,
description: 'Name of the database to create'
},
'KuberoMysql.spec.mysql.auth.rootPassword':{
type: 'text',
label: 'Root Password*',
name: 'spec.mysql.auth.rootPassword',
default: '',
required: true,
description: 'Root Password'
},
'KuberoMysql.spec.mysql.auth.username':{
type: 'text',
label: 'Username*',
name: 'spec.mysql.auth.username',
default: '',
required: true,
description: 'Additional username'
},
'KuberoMysql.spec.mysql.auth.password':{
type: 'text',
label: 'User Password*',
name: 'spec.mysql.auth.password',
default: '',
required: true,
description: 'Password for the additional user'
},
};
public env: any[] = []
protected additionalResourceDefinitions: Object = {}
constructor(availableOperators: any) {
super();
super.init(availableOperators);
}
}