-
Notifications
You must be signed in to change notification settings - Fork 2k
/
cluster.d.ts
107 lines (103 loc) · 2.37 KB
/
cluster.d.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
104
105
106
107
import { DBStatusEnum, DBTypeEnum, PodStatusEnum } from '@/constants/db';
export type KbPgClusterType = {
apiVersion: 'apps.kubeblocks.io/v1alpha1';
kind: 'Cluster';
metadata: {
annotations: Record<string, string>;
creationTimestamp: Date;
labels: {
'clusterdefinition.kubeblocks.io/name': `${DBTypeEnum}`;
'clusterversion.kubeblocks.io/name': string;
'sealos-db-provider/postgresql': string;
};
name: string;
namespace: string;
uid: string;
};
spec: KubeBlockClusterSpec;
status?: KubeBlockClusterStatus;
};
export interface KubeBlockClusterSpec {
clusterDefinitionRef: `${DBTypeEnum}`;
clusterVersionRef: string;
terminationPolicy: string;
componentSpecs: {
componentDefRef: `${DBTypeEnum}`;
name: `${DBTypeEnum}`;
replicas: number;
resources: {
limits: {
cpu: string;
memory: string;
};
requests: {
cpu: string;
memory: string;
};
};
volumeClaimTemplates: {
name: 'data';
spec: {
accessModes: ['ReadWriteOnce'];
resources: {
requests: {
storage: string;
};
};
};
}[];
}[];
backup: {
enabled: boolean;
cronExpression: string;
method: string;
pitrEnabled: boolean;
repoName: string;
retentionPeriod: string;
};
}
export interface KubeBlockClusterStatus {
clusterDefGeneration: number;
components: object;
conditions: k8s.V1Condition[];
observedGeneration: number;
phase: `${DBStatusEnum}`;
}
export type KbPodType = {
metadata: {
name: string;
uid: string;
labels: {
'app.kubernetes.io/component': string;
'app.kubernetes.io/instance': string;
'app.kubernetes.io/managed-by': string;
'app.kubernetes.io/name': string;
'app.kubernetes.io/version': string;
'apps.kubeblocks.io/component-name': string;
'apps.kubeblocks.io/workload-type': string;
'controller-revision-hash': string;
'kubeblocks.io/role': string;
'statefulset.kubernetes.io/pod-name': string;
};
};
status: {
phase: `${PodStatusEnum}`;
};
};
export type KubeBlockBackupPolicyType = {
metadata: {
name: string;
uid: string;
};
spec: {
retention: {
ttl: string;
};
schedule: {
datafile: {
cronExpression: string;
enable: boolean;
};
};
};
};