@alauda-fe/storage 0.0.9 → 0.0.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/esm2022/lib/components/pvc-form/component.mjs +127 -123
- package/esm2022/lib/components/storage-feature-tags/component.mjs +19 -21
- package/esm2022/lib/components/storageclass-select/component.mjs +30 -15
- package/esm2022/lib/services/common-util.service.mjs +13 -25
- package/esm2022/lib/services/pvc-util.service.mjs +4 -4
- package/esm2022/lib/types/commons.mjs +2 -1
- package/esm2022/lib/types/k8s.mjs +36 -2
- package/esm2022/lib/utils/constants.mjs +2 -1
- package/esm2022/lib/utils/util.mjs +1 -4
- package/lib/components/pvc-form/component.d.ts +2 -0
- package/lib/components/storage-feature-tags/component.d.ts +1 -1
- package/lib/services/common-util.service.d.ts +6 -4
- package/lib/types/commons.d.ts +2 -1
- package/lib/types/k8s.d.ts +348 -1
- package/lib/utils/constants.d.ts +1 -0
- package/lib/utils/util.d.ts +1 -2
- package/package.json +1 -1
package/lib/types/commons.d.ts
CHANGED
|
@@ -21,7 +21,8 @@ export declare const StorageType: {
|
|
|
21
21
|
export type StorageType = ValueOf<typeof StorageType>;
|
|
22
22
|
export declare enum StorageclassFeature {
|
|
23
23
|
SNAPSHOT = "snapshot",
|
|
24
|
-
EXPANSION = "expansion"
|
|
24
|
+
EXPANSION = "expansion",
|
|
25
|
+
CLONE = "clone"
|
|
25
26
|
}
|
|
26
27
|
export interface StorageOption {
|
|
27
28
|
provisioner: StorageProvisioner;
|
package/lib/types/k8s.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AccessMode, KubernetesResource, StringMap } from '@alauda-fe/common';
|
|
1
|
+
import { AccessMode, Condition, KubernetesResource, StringMap, Affinity, ResourceRequirements } from '@alauda-fe/common';
|
|
2
2
|
import { ReclaimPolicy, StorageProvisioner, VolumeBindingMode } from './commons';
|
|
3
3
|
export interface VolumeSnapshotClass extends KubernetesResource {
|
|
4
4
|
driver: string;
|
|
@@ -103,3 +103,350 @@ export interface PersistentVolumeSpecMeta {
|
|
|
103
103
|
};
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
+
export interface VolumeClaimTemplate extends KubernetesResource {
|
|
107
|
+
spec: {
|
|
108
|
+
accessModes: string[];
|
|
109
|
+
resources: {
|
|
110
|
+
requests: {
|
|
111
|
+
storage: string;
|
|
112
|
+
};
|
|
113
|
+
};
|
|
114
|
+
storageClassName: string;
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
export interface CephClusterNetwork {
|
|
118
|
+
ipFamily?: string;
|
|
119
|
+
provider?: string;
|
|
120
|
+
}
|
|
121
|
+
export interface CephClusterStatus {
|
|
122
|
+
ceph: {
|
|
123
|
+
health: string;
|
|
124
|
+
lastChecked: string;
|
|
125
|
+
details: unknown;
|
|
126
|
+
capacity?: {
|
|
127
|
+
bytesAvailable: number;
|
|
128
|
+
bytesTotal: number;
|
|
129
|
+
bytesUsed: number;
|
|
130
|
+
lastUpdated: string;
|
|
131
|
+
};
|
|
132
|
+
};
|
|
133
|
+
conditions: Condition[];
|
|
134
|
+
message: string;
|
|
135
|
+
phase: string;
|
|
136
|
+
state: string;
|
|
137
|
+
version: {
|
|
138
|
+
image: string;
|
|
139
|
+
version: string;
|
|
140
|
+
};
|
|
141
|
+
storage: {
|
|
142
|
+
deviceClasses: Array<{
|
|
143
|
+
name: string;
|
|
144
|
+
}>;
|
|
145
|
+
};
|
|
146
|
+
network: CephClusterNetwork;
|
|
147
|
+
}
|
|
148
|
+
declare const CephResourceConfigurationKeys: readonly ["mgr", "mon", "osd", "rbdmirror", "prepareosd", "crashcollector", "cleanup"];
|
|
149
|
+
export interface CephDashBoardSpec {
|
|
150
|
+
enabled: boolean;
|
|
151
|
+
urlPrefix?: string;
|
|
152
|
+
port?: number;
|
|
153
|
+
ssl?: boolean;
|
|
154
|
+
}
|
|
155
|
+
export interface StretchCluster {
|
|
156
|
+
failureDomainLabel: string;
|
|
157
|
+
subFailureDomain: string;
|
|
158
|
+
zones: Array<{
|
|
159
|
+
name: string;
|
|
160
|
+
arbiter?: boolean;
|
|
161
|
+
}>;
|
|
162
|
+
}
|
|
163
|
+
export interface CephMonSettings {
|
|
164
|
+
count: number;
|
|
165
|
+
allowMultiplePerNode?: boolean;
|
|
166
|
+
volumeClaimTemplate?: PersistentVolumeSpec;
|
|
167
|
+
stretchCluster?: StretchCluster;
|
|
168
|
+
}
|
|
169
|
+
export interface CephMgrSettings {
|
|
170
|
+
modules: Array<{
|
|
171
|
+
name: string;
|
|
172
|
+
enabled: boolean;
|
|
173
|
+
}>;
|
|
174
|
+
count?: number;
|
|
175
|
+
}
|
|
176
|
+
export interface CephOsdConfiguration {
|
|
177
|
+
metadataDevice?: string;
|
|
178
|
+
storeType?: string;
|
|
179
|
+
databaseSizeMB?: number;
|
|
180
|
+
walSizeMB?: number;
|
|
181
|
+
osdsPerDevice?: number;
|
|
182
|
+
encryptedDevice?: boolean;
|
|
183
|
+
deviceClass?: string;
|
|
184
|
+
}
|
|
185
|
+
export interface CephNodeSettings {
|
|
186
|
+
name: string;
|
|
187
|
+
config?: CephOsdConfiguration;
|
|
188
|
+
useAllDevices?: boolean;
|
|
189
|
+
deviceFilter?: RegExp;
|
|
190
|
+
devicePathFilter?: RegExp;
|
|
191
|
+
devices?: Array<{
|
|
192
|
+
config?: {
|
|
193
|
+
deviceClass: string;
|
|
194
|
+
};
|
|
195
|
+
name: string;
|
|
196
|
+
}>;
|
|
197
|
+
}
|
|
198
|
+
export interface CephDisruptionManagement {
|
|
199
|
+
managePodBudgets?: boolean;
|
|
200
|
+
osdMaintenanceTimeout?: number;
|
|
201
|
+
manageMachineDisruptionBudgets?: boolean;
|
|
202
|
+
machineDisruptionBudgetNamespace?: string;
|
|
203
|
+
}
|
|
204
|
+
export interface CephStorageSettings {
|
|
205
|
+
useAllNodes?: boolean;
|
|
206
|
+
nodes: CephNodeSettings[];
|
|
207
|
+
}
|
|
208
|
+
declare const CephPlacementConfigurationKeys: readonly ["mgr", "mon", "rbdmirror", "cleanup", "all", "osd"];
|
|
209
|
+
export interface CephPlacementNodeAffinity {
|
|
210
|
+
requiredDuringSchedulingIgnoredDuringExecution: {
|
|
211
|
+
nodeSelectorTerms: Array<{
|
|
212
|
+
matchExpressions: Array<{
|
|
213
|
+
key: string;
|
|
214
|
+
operator: 'In' | 'NotIn' | 'Exists' | 'DoesNotExist';
|
|
215
|
+
values?: string[];
|
|
216
|
+
}>;
|
|
217
|
+
}>;
|
|
218
|
+
};
|
|
219
|
+
}
|
|
220
|
+
export interface CephPlacementConfiguration {
|
|
221
|
+
nodeAffinity?: CephPlacementNodeAffinity;
|
|
222
|
+
podAffinity?: Affinity;
|
|
223
|
+
podAntiAffinity?: Affinity;
|
|
224
|
+
tolerations?: any[];
|
|
225
|
+
topologySpreadConstraints?: any[];
|
|
226
|
+
}
|
|
227
|
+
export interface CephClusterSpec {
|
|
228
|
+
priorityClassNames?: StringMap;
|
|
229
|
+
external?: {
|
|
230
|
+
enable: boolean;
|
|
231
|
+
};
|
|
232
|
+
cephVersion: {
|
|
233
|
+
image: string;
|
|
234
|
+
allowUnsupported?: boolean;
|
|
235
|
+
};
|
|
236
|
+
dataDirHostPath: string;
|
|
237
|
+
skipUpgradeChecks?: boolean;
|
|
238
|
+
continueUpgradeAfterChecksEvenIfNotHealthy?: boolean;
|
|
239
|
+
dashboard?: CephDashBoardSpec;
|
|
240
|
+
mon: CephMonSettings;
|
|
241
|
+
mgr?: CephMgrSettings;
|
|
242
|
+
storage?: CephStorageSettings;
|
|
243
|
+
removeOSDsIfOutAndSafeToRemove?: boolean;
|
|
244
|
+
crashCollector?: {
|
|
245
|
+
disable: boolean;
|
|
246
|
+
};
|
|
247
|
+
network?: CephClusterNetwork;
|
|
248
|
+
disruptionManagement?: CephDisruptionManagement;
|
|
249
|
+
placement?: Partial<Record<Partial<typeof CephPlacementConfigurationKeys>[number], CephPlacementConfiguration>>;
|
|
250
|
+
resources?: Partial<Record<Partial<typeof CephResourceConfigurationKeys>[number], {
|
|
251
|
+
requests: {
|
|
252
|
+
cpu: string;
|
|
253
|
+
memory: string;
|
|
254
|
+
};
|
|
255
|
+
}>>;
|
|
256
|
+
monitoring?: {
|
|
257
|
+
enabled: boolean;
|
|
258
|
+
ruleNamespace?: string;
|
|
259
|
+
};
|
|
260
|
+
}
|
|
261
|
+
export interface CephCluster extends KubernetesResource {
|
|
262
|
+
spec: CephClusterSpec;
|
|
263
|
+
status?: CephClusterStatus;
|
|
264
|
+
}
|
|
265
|
+
export interface CephObjectPoolSpec {
|
|
266
|
+
deviceClass?: string;
|
|
267
|
+
failureDomain?: string;
|
|
268
|
+
replicated: {
|
|
269
|
+
size: number;
|
|
270
|
+
requireSafeReplicaSize?: boolean;
|
|
271
|
+
};
|
|
272
|
+
parameters?: {
|
|
273
|
+
compression_mode?: string;
|
|
274
|
+
};
|
|
275
|
+
}
|
|
276
|
+
export interface CephMetadataServer {
|
|
277
|
+
activeCount: number;
|
|
278
|
+
activeStandby?: boolean;
|
|
279
|
+
placement?: CephPlacementConfiguration;
|
|
280
|
+
resources: ResourceRequirements;
|
|
281
|
+
}
|
|
282
|
+
export interface CephFileSystem extends KubernetesResource {
|
|
283
|
+
spec: {
|
|
284
|
+
metadataPool?: any;
|
|
285
|
+
dataPools?: CephObjectPoolSpec[];
|
|
286
|
+
preservePoolsOnDelete?: boolean;
|
|
287
|
+
metadataServer?: CephMetadataServer;
|
|
288
|
+
};
|
|
289
|
+
status?: {
|
|
290
|
+
phase: string;
|
|
291
|
+
};
|
|
292
|
+
}
|
|
293
|
+
export interface CephBlockPool extends KubernetesResource {
|
|
294
|
+
spec: {
|
|
295
|
+
deviceClass?: string;
|
|
296
|
+
failureDomain: string;
|
|
297
|
+
replicated: {
|
|
298
|
+
size: number;
|
|
299
|
+
};
|
|
300
|
+
};
|
|
301
|
+
status?: any;
|
|
302
|
+
}
|
|
303
|
+
export interface CephObjectStore extends KubernetesResource {
|
|
304
|
+
spec: CephObjectStoreSpec;
|
|
305
|
+
}
|
|
306
|
+
export interface CephObjectStoreGateway {
|
|
307
|
+
type: string;
|
|
308
|
+
port: number;
|
|
309
|
+
instances: number;
|
|
310
|
+
placement: {
|
|
311
|
+
nodeAffinity: CephPlacementNodeAffinity;
|
|
312
|
+
};
|
|
313
|
+
annotations: unknown;
|
|
314
|
+
resources: {
|
|
315
|
+
limits: StringMap;
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
export interface CephObjectStoreSpec {
|
|
319
|
+
metadataPool?: CephObjectPoolSpec;
|
|
320
|
+
dataPool?: CephObjectPoolSpec;
|
|
321
|
+
preservePoolsOnDelete?: boolean;
|
|
322
|
+
gateway?: CephObjectStoreGateway;
|
|
323
|
+
}
|
|
324
|
+
export interface TopolvmNodeStorageStateClass {
|
|
325
|
+
className: string;
|
|
326
|
+
vgName: string;
|
|
327
|
+
deviceStates?: Array<{
|
|
328
|
+
name: string;
|
|
329
|
+
message?: string;
|
|
330
|
+
state: 'Online' | 'Offline';
|
|
331
|
+
}>;
|
|
332
|
+
state: 'Ready' | 'UnReady';
|
|
333
|
+
}
|
|
334
|
+
export interface TopolvmClusterStatus {
|
|
335
|
+
phase?: 'Ready' | 'Failure';
|
|
336
|
+
nodeStorageState?: Array<{
|
|
337
|
+
failClasses: TopolvmNodeStorageStateClass[];
|
|
338
|
+
successClasses: TopolvmNodeStorageStateClass[];
|
|
339
|
+
node: string;
|
|
340
|
+
phase: 'Ready' | 'Failure' | 'Unknown' | 'Pending' | '';
|
|
341
|
+
}>;
|
|
342
|
+
}
|
|
343
|
+
export type TopolvmDeviceType = 'disk' | 'loop' | 'lvm';
|
|
344
|
+
export declare enum TopolvmClusterStorageDeviceClassStatusEnum {
|
|
345
|
+
AVAILABLE = "available",
|
|
346
|
+
NOT_AVAILABLE = "not_available"
|
|
347
|
+
}
|
|
348
|
+
export interface TopolvmClusterSpecDeviceClassItem {
|
|
349
|
+
className: string;
|
|
350
|
+
default: boolean;
|
|
351
|
+
volumeGroup: string;
|
|
352
|
+
devices: Array<{
|
|
353
|
+
name: string;
|
|
354
|
+
type: TopolvmDeviceType;
|
|
355
|
+
}>;
|
|
356
|
+
}
|
|
357
|
+
export interface TopolvmClusterSpecDeviceClass {
|
|
358
|
+
nodeName: string;
|
|
359
|
+
classes: TopolvmClusterSpecDeviceClassItem[];
|
|
360
|
+
}
|
|
361
|
+
export interface TopolvmClusterV2Spec {
|
|
362
|
+
cleanup?: boolean;
|
|
363
|
+
topolvmVersion: string;
|
|
364
|
+
storage?: {
|
|
365
|
+
deviceClasses: TopolvmClusterSpecDeviceClass[];
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
export interface TopolvmClusterV2 extends KubernetesResource {
|
|
369
|
+
spec: TopolvmClusterV2Spec;
|
|
370
|
+
status?: TopolvmClusterStatus;
|
|
371
|
+
}
|
|
372
|
+
export declare enum HealthStatus {
|
|
373
|
+
GREEN = "green",
|
|
374
|
+
YELLOW = "yellow",
|
|
375
|
+
RED = "red"
|
|
376
|
+
}
|
|
377
|
+
export declare enum PoolState {
|
|
378
|
+
POOL_NOT_CREATED = "PoolNotCreated",
|
|
379
|
+
POOL_CREATED = "PoolCreated",
|
|
380
|
+
POOL_INITIALIZED = "PoolInitialized"
|
|
381
|
+
}
|
|
382
|
+
export interface MinioClusterStatus {
|
|
383
|
+
currentState: string;
|
|
384
|
+
healthStatus: HealthStatus;
|
|
385
|
+
drivesOnline: number;
|
|
386
|
+
pools: Array<{
|
|
387
|
+
ssName: string;
|
|
388
|
+
state: PoolState;
|
|
389
|
+
}>;
|
|
390
|
+
usage: {
|
|
391
|
+
capacity: number;
|
|
392
|
+
usage: number;
|
|
393
|
+
rawCapacity: number;
|
|
394
|
+
rawUsage: number;
|
|
395
|
+
};
|
|
396
|
+
}
|
|
397
|
+
export interface MinioClusterPool {
|
|
398
|
+
affinity: {
|
|
399
|
+
podAntiAffinity?: Affinity;
|
|
400
|
+
nodeAffinity?: Affinity;
|
|
401
|
+
};
|
|
402
|
+
name: string;
|
|
403
|
+
servers: number;
|
|
404
|
+
volumesPerServer: number;
|
|
405
|
+
volumeClaimTemplate: VolumeClaimTemplate;
|
|
406
|
+
tolerations?: Array<{
|
|
407
|
+
effect: string;
|
|
408
|
+
operator: string;
|
|
409
|
+
}>;
|
|
410
|
+
resources?: {
|
|
411
|
+
limits?: {
|
|
412
|
+
cpu: string;
|
|
413
|
+
memory: string;
|
|
414
|
+
};
|
|
415
|
+
requests?: {
|
|
416
|
+
cpu: string;
|
|
417
|
+
memory: string;
|
|
418
|
+
};
|
|
419
|
+
};
|
|
420
|
+
}
|
|
421
|
+
export interface MinioClusterSpec {
|
|
422
|
+
configuration: {
|
|
423
|
+
name: string;
|
|
424
|
+
};
|
|
425
|
+
credsSecret: {
|
|
426
|
+
name: string;
|
|
427
|
+
};
|
|
428
|
+
image?: string;
|
|
429
|
+
requestAutoCert: boolean;
|
|
430
|
+
pools: MinioClusterPool[];
|
|
431
|
+
externalCertSecret?: Array<{
|
|
432
|
+
name: string;
|
|
433
|
+
type: string;
|
|
434
|
+
}>;
|
|
435
|
+
sideCars?: {
|
|
436
|
+
resources: {
|
|
437
|
+
limits?: {
|
|
438
|
+
cpu: string;
|
|
439
|
+
memory: string;
|
|
440
|
+
};
|
|
441
|
+
requests?: {
|
|
442
|
+
cpu: string;
|
|
443
|
+
memory: string;
|
|
444
|
+
};
|
|
445
|
+
};
|
|
446
|
+
};
|
|
447
|
+
}
|
|
448
|
+
export interface MinioCluster extends KubernetesResource {
|
|
449
|
+
spec: MinioClusterSpec;
|
|
450
|
+
status?: MinioClusterStatus;
|
|
451
|
+
}
|
|
452
|
+
export {};
|
package/lib/utils/constants.d.ts
CHANGED
package/lib/utils/util.d.ts
CHANGED
|
@@ -4,9 +4,8 @@ import { CommonStorageClass, PersistentVolume, StorageClass, VolumeSnapshot, Vol
|
|
|
4
4
|
import { VolumeSnapshotStatus } from './constants';
|
|
5
5
|
export declare function getProvisioner(sc: CommonStorageClass | StorageOption): StorageProvisioner;
|
|
6
6
|
export declare function getProvisionerDisplay(sc: CommonStorageClass | StorageOption): Translation;
|
|
7
|
-
export declare function getProvisionerType(provisioner: StorageProvisioner): "file_storage" | "object_storage" | "block_storage" | "unknown";
|
|
8
7
|
export declare function getStorageclassVolumeModes(provisioner: StorageProvisioner): ("Filesystem" | "Block")[];
|
|
9
|
-
export declare function getStorageclassAccessModes(provisioner: StorageProvisioner, isFromSnapshot?: boolean): ("ReadWriteOnce" | "ReadOnlyMany" | "ReadWriteMany")[];
|
|
8
|
+
export declare function getStorageclassAccessModes(provisioner: StorageProvisioner, isFromSnapshot?: boolean): ("ReadWriteOnce" | "ReadOnlyMany" | "ReadWriteMany" | "ReadWriteOncePod")[];
|
|
10
9
|
export declare function isDefaultStorageclass(data: CommonStorageClass): boolean;
|
|
11
10
|
export declare function isStorageClassSupportSnapshot(sc: StorageClass, vscList: VolumeSnapshotClass[]): boolean;
|
|
12
11
|
export declare function buildPvcResource({ namespace, snapshot, volumeMode, }: {
|