Drop initial code

This commit is contained in:
Danny Bessems
2026-01-15 09:58:01 +00:00
parent 227d957219
commit 1e7c9ba5cb
228 changed files with 19883 additions and 1 deletions

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 548 KiB

View File

@@ -0,0 +1,29 @@
sequenceDiagram
participant User
participant Controller
participant InfraBP as InfraBlueprint
participant ProviderBP as Harvester/Vsphere BP
participant Strategy
participant Builder as MasterBuilder
participant Helm
User->>Controller: Create ClusterBlueprint
Controller->>InfraBP: 1. Get Infra & Quota
InfraBP-->>Controller: ProviderRef (Kind="HarvesterBlueprint")
note over Controller: Dynamic Switching Logic
alt Kind is Harvester
Controller->>ProviderBP: 2. Get Harvester Config
Controller->>Strategy: 3. Init HarvesterStrategy
else Kind is Vsphere
Controller->>ProviderBP: 2. Get Vsphere Config
Controller->>Strategy: 3. Init VsphereStrategy
end
Controller->>Builder: 4. Build(Strategy)
Builder->>Strategy: GenerateNodePools()
Strategy-->>Builder: [Pool A, Pool B]
Builder-->>Controller: map[values]
Controller->>Helm: 5. Apply(values)

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 504 KiB

View File

@@ -0,0 +1,121 @@
classDiagram
direction TB
%% ==========================================
%% PACKAGE: K8s API Definitions (Blueprints)
%% ==========================================
namespace API_Blueprints {
class ClusterBlueprint {
<<Kind: ClusterBlueprint, Short: cbp>>
Description: Generic cluster request
---
+spec.infraBlueprintRef : string
+spec.kubernetesVersion : string
+spec.workerPools : List~GenericPoolReq~
}
class InfraBlueprint {
<<Kind: InfraBlueprint, Short: ibp>>
Description: Manages quotas and provider ref
---
+spec.quotaLimits : ResourceList
+status.quotaUsed : ResourceList
+spec.providerRef : TypedLocalObjectReference
}
class VsphereBlueprint {
<<Kind: VsphereBlueprint, Short: vbp>>
Description: Concrete vSphere details
---
+spec.vcenterURL : string
+spec.datacenterID : string
+spec.networkIDs : List~string~
}
class HarvesterBlueprint {
<<Kind: HarvesterBlueprint, Short: hbp>>
Description: Concrete Harvester details
---
+spec.harvesterURL : string
+spec.vmNamespace : string
+spec.imageName : string
}
class AzureBlueprint {
<<Kind: AzureBlueprint, Short: abp>>
Description: Future Azure details
}
}
%% Relationships between Blueprints
ClusterBlueprint --> InfraBlueprint : 1. References by Name
note for InfraBlueprint "The providerRef is polymorphic.\nIt points to ANY ProviderBlueprint Kind\n(vbp, hbp, or abp)."
InfraBlueprint ..> VsphereBlueprint : 2. Dynamically references Kind=vbp
InfraBlueprint ..> HarvesterBlueprint : 2. Dynamically references Kind=hbp
InfraBlueprint ..> AzureBlueprint : 2. Dynamically references Kind=abp
%% ==========================================
%% PACKAGE: Controller (Orchestration)
%% ==========================================
namespace Controller_Layer {
class RIGController {
Description: The brain. Watches CBPs, checks IBP quotas.
---
+Reconcile(request)
}
}
RIGController "watches" --> ClusterBlueprint
RIGController "reads & checks quota" --> InfraBlueprint
%% ==========================================
%% PACKAGE: Builders & Strategies (Generation)
%% ==========================================
namespace Generation_Layer {
class MasterValuesBuilder {
Description: Knows generic Helm structure.
---
-strategy : ProviderStrategy
+BuildHelmValues(cbp, ibp) Map
}
class ProviderStrategy {
<<Interface>>
Description: Contract for isolated provider logic.
---
+GenerateNodePools(genericPools, providerBP) List~Any~
+GetGlobalOverrides(providerBP) Map
+PerformPreFlight(ctx, providerBP) Error
}
class VsphereStrategy {
Description: Specialist VBP to Helm translation.
---
+GenerateNodePools(...)
}
class HarvesterStrategy {
Description: Specialist HBP to Helm translation.
---
+GenerateNodePools(...)
+PerformPreFlight(...)
}
}
%% Controller orchestrates builders
note for RIGController "1. Reads IBP.providerRef.Kind\n2. Instantiates correct Strategy (e.g. VsphereStrategy)\n3. Injects Strategy into MasterBuilder\n4. Calls MasterBuilder.Build()"
RIGController "configures & calls" --> MasterValuesBuilder
%% Master Builder uses the interface
MasterValuesBuilder o--> ProviderStrategy : Injected Dependency
%% Realization of strategies
ProviderStrategy <|.. VsphereStrategy : Implements
ProviderStrategy <|.. HarvesterStrategy : Implements
%% Strategies read their specific blueprints
VsphereStrategy ..> VsphereBlueprint : Reads config to map data
HarvesterStrategy ..> HarvesterBlueprint : Reads config to map data