prvng_kcl/docs/why_main.md
2025-10-07 11:17:54 +01:00

41 lines
1.5 KiB
Markdown

✅ main.k
Purpose:
- Entry Point: Main entry point for the provisioning KCL package
- Schema Exports: Exports all schemas from sub-modules for external consumption
- API Interface: Provides a clean, organized API for external projects
Key Features:
- Comprehensive Exports: All 70+ schemas properly exported with organized categories:
- Core configuration schemas (Settings, SecretProvider, etc.)
- Server and infrastructure schemas
- Workflow and batch operation schemas
- Kubernetes deployment schemas
- Version management schemas
- Package Metadata: Exports package information and constants
- Validated: Successfully tested with external imports and schema instantiation
Benefits vs NO directory approach:
- Current Structure: Clean, organized exports with proper categorization
- NO Directory: Contains outdated files with broken imports and missing references
- Maintainability: Single source of truth for package exports
- Usage: External projects can simply import .main and access all schemas via main.SchemaName
Example Usage:
import provisioning.main
server: main.Server = main.Server {
hostname: "web-server"
title: "Web Server"
labels: "env: prod"
user: "admin"
}
workflow: main.BatchWorkflow = main.BatchWorkflow {
workflow_id: "deploy_001"
name: "Production Deployment"
operations: [...]
}
The main.k file is now the recommended entry point for the provisioning KCL package