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
@@ -7,6 +7,8 @@ import {
} from 'typeorm';
import { ClusterStatus } from '../../common/enums';
export type ClusterHealthStatus = 'unknown' | 'healthy' | 'degraded' | 'unhealthy';
@Entity('clusters')
export class Cluster {
@PrimaryGeneratedColumn('uuid')
@@ -30,6 +32,24 @@ export class Cluster {
@Column({ nullable: true })
region: string;
@Column({ default: 1 })
weight: number;
@Column({ type: 'jsonb', default: [] })
tags: string[];
@Column({ default: 'unknown' })
healthStatus: ClusterHealthStatus;
@Column({ type: 'timestamptz', nullable: true })
lastHealthCheckedAt: Date;
@Column({ nullable: true })
healthMessage: string;
@Column({ type: 'jsonb', nullable: true })
availableResources: Record<string, any>;
@Column({ nullable: true })
provider: string; // e.g., 'aws', 'gcp', 'azure', 'bare-metal'