Add automatic cluster pool allocation.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
keyhan
2026-05-18 23:08:06 +03:30
parent 97e4c865b6
commit 72a1519ea0
19 changed files with 983 additions and 151 deletions
+43 -2
View File
@@ -169,9 +169,15 @@ export interface Cluster {
name: string;
description?: string;
status: 'active' | 'inactive' | 'maintenance';
healthStatus?: 'unknown' | 'healthy' | 'degraded' | 'unhealthy';
lastHealthCheckedAt?: string;
healthMessage?: string;
apiServer: string;
region?: string;
provider?: string;
weight: number;
tags: string[];
availableResources?: Record<string, any>;
isDefault: boolean;
defaultCpuLimit: string;
defaultMemoryLimit: string;
@@ -241,15 +247,18 @@ export interface ClusterPublic {
provider?: string;
isDefault: boolean;
status: 'active' | 'inactive' | 'maintenance';
healthStatus?: 'unknown' | 'healthy' | 'degraded' | 'unhealthy';
}
export interface ClusterPoolPublic {
id: string;
name: string;
description?: string;
strategy: 'least-apps' | 'round-robin';
strategy: 'least-apps' | 'round-robin' | 'weighted-resource';
clusterIds: string[];
isActive: boolean;
isDefault: boolean;
priority: number;
clusters: Pick<ClusterPublic, 'id' | 'name' | 'region' | 'provider' | 'status'>[];
}
@@ -257,9 +266,41 @@ export interface ClusterPool {
id: string;
name: string;
description?: string;
strategy: 'least-apps' | 'round-robin';
strategy: 'least-apps' | 'round-robin' | 'weighted-resource';
clusterIds: string[];
isActive: boolean;
isDefault: boolean;
priority: number;
createdAt: string;
}
export interface ClusterHealth {
id: string;
clusterId: string;
status: 'unknown' | 'healthy' | 'degraded' | 'unhealthy';
readyNodes: number;
nodeCount: number;
cpuAllocatable?: string;
memoryAllocatable?: string;
podCount: number;
appCount: number;
message?: string;
resources?: Record<string, any>;
checkedAt: string;
}
export interface ClusterAllocationLog {
id: string;
applicationId?: string;
userId: string;
poolId?: string;
selectedClusterId?: string;
strategy: 'least-apps' | 'round-robin' | 'weighted-resource';
estimatedRequest?: Record<string, any>;
candidateScores?: Record<string, any>[];
rejectionReasons?: Record<string, any>[];
status: 'success' | 'failed';
message?: string;
createdAt: string;
}