459 lines
12 KiB
Markdown
459 lines
12 KiB
Markdown
|
|
# Provisioning KCL Package - Changelog
|
||
|
|
|
||
|
|
**Date**: 2025-12-11
|
||
|
|
**Repository**: provisioning/kcl
|
||
|
|
**Changes**: Infrastructure schemas, configuration modules, and type-safe KCL definitions
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 📋 Summary
|
||
|
|
|
||
|
|
Type-safe KCL (KusionStack Configuration Language) schemas for infrastructure automation, batch workflows, Kubernetes deployments, and comprehensive system configuration management.
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 📁 Changes by Module
|
||
|
|
|
||
|
|
### Core Schemas
|
||
|
|
|
||
|
|
#### main.k
|
||
|
|
- **Purpose**: Main entry point for the package
|
||
|
|
- **Exports**: All public schemas and configurations
|
||
|
|
- **Integration**: Central import location for consumers
|
||
|
|
- **Status**: Stable, comprehensive coverage
|
||
|
|
|
||
|
|
#### lib.k (1,553 bytes)
|
||
|
|
- **Purpose**: Common schemas and utility definitions
|
||
|
|
- **Provides**:
|
||
|
|
- Base schema definitions
|
||
|
|
- Shared type definitions
|
||
|
|
- Common validation functions
|
||
|
|
- Utility schemas for cross-module use
|
||
|
|
- **Status**: Stable, foundational
|
||
|
|
|
||
|
|
#### settings.k (5,473 bytes)
|
||
|
|
- **Purpose**: Core system settings and configuration defaults
|
||
|
|
- **Defines**:
|
||
|
|
- System-wide settings schemas
|
||
|
|
- Configuration parameter definitions
|
||
|
|
- Default values and constraints
|
||
|
|
- Setting validation rules
|
||
|
|
- **Status**: Updated (2025-12-11)
|
||
|
|
|
||
|
|
#### defaults.k (3,108 bytes)
|
||
|
|
- **Purpose**: Default configurations for all infrastructure components
|
||
|
|
- **Includes**:
|
||
|
|
- Server defaults
|
||
|
|
- Cluster defaults
|
||
|
|
- Service defaults
|
||
|
|
- Resource allocation defaults
|
||
|
|
- **Status**: Stable
|
||
|
|
|
||
|
|
#### version.k (1,620 bytes)
|
||
|
|
- **Purpose**: Version management and semantic versioning schemas
|
||
|
|
- **Provides**:
|
||
|
|
- Version definition schemas
|
||
|
|
- Semantic version validation
|
||
|
|
- Version compatibility checking
|
||
|
|
- Version constraint specifications
|
||
|
|
- **Status**: Updated (2025-12-08)
|
||
|
|
|
||
|
|
### Infrastructure Schemas
|
||
|
|
|
||
|
|
#### server.k (1,749 bytes)
|
||
|
|
- **Purpose**: Server configuration and management schemas
|
||
|
|
- **Defines**:
|
||
|
|
- Server resource schemas
|
||
|
|
- Network configuration
|
||
|
|
- Storage configuration
|
||
|
|
- Server lifecycle management
|
||
|
|
- **Status**: Stable
|
||
|
|
|
||
|
|
#### cluster.k (918 bytes)
|
||
|
|
- **Purpose**: Kubernetes cluster management schemas
|
||
|
|
- **Includes**:
|
||
|
|
- Cluster topology definitions
|
||
|
|
- Node configuration
|
||
|
|
- Network policies
|
||
|
|
- Cluster resource management
|
||
|
|
- **Status**: Stable
|
||
|
|
|
||
|
|
#### services.k (6,848 bytes)
|
||
|
|
- **Purpose**: Taskserv (infrastructure service) schemas and definitions
|
||
|
|
- **Defines**:
|
||
|
|
- Service configuration schemas
|
||
|
|
- Service dependencies
|
||
|
|
- Service lifecycle management
|
||
|
|
- Service integration points
|
||
|
|
- **Status**: Updated (2025-12-11)
|
||
|
|
|
||
|
|
#### dependencies.k (9,554 bytes)
|
||
|
|
- **Purpose**: Taskserv dependency management and resolution
|
||
|
|
- **Provides**:
|
||
|
|
- Dependency graph schemas
|
||
|
|
- Dependency resolution algorithms
|
||
|
|
- Constraint satisfaction
|
||
|
|
- Circular dependency detection
|
||
|
|
- **Status**: Stable (updated 2025-10-06)
|
||
|
|
|
||
|
|
### Advanced Configuration
|
||
|
|
|
||
|
|
#### modes.k (24,714 bytes)
|
||
|
|
- **Purpose**: Deployment mode schemas and configurations
|
||
|
|
- **Includes**:
|
||
|
|
- Mode definitions (solo, multiuser, cicd, enterprise)
|
||
|
|
- Mode-specific resource allocation
|
||
|
|
- Mode-specific feature flags
|
||
|
|
- Mode validation and constraints
|
||
|
|
- **Status**: Updated (2025-12-11)
|
||
|
|
|
||
|
|
#### golden_image.k (7,020 bytes)
|
||
|
|
- **Purpose**: Golden image configuration and management
|
||
|
|
- **Defines**:
|
||
|
|
- Image base schemas
|
||
|
|
- Image customization configurations
|
||
|
|
- Image lifecycle management
|
||
|
|
- Image validation rules
|
||
|
|
- **Status**: Updated (2025-12-11)
|
||
|
|
|
||
|
|
#### vm.k (8,698 bytes)
|
||
|
|
- **Purpose**: Virtual machine configuration and provisioning
|
||
|
|
- **Includes**:
|
||
|
|
- VM resource schemas
|
||
|
|
- VM network configuration
|
||
|
|
- VM storage management
|
||
|
|
- VM lifecycle operations
|
||
|
|
- **Status**: Updated (2025-12-11)
|
||
|
|
|
||
|
|
#### vm_lifecycle.k (7,724 bytes)
|
||
|
|
- **Purpose**: VM lifecycle management and state transitions
|
||
|
|
- **Provides**:
|
||
|
|
- Lifecycle state definitions
|
||
|
|
- State transition validations
|
||
|
|
- Lifecycle event schemas
|
||
|
|
- Health monitoring configurations
|
||
|
|
- **Status**: Updated (2025-12-11)
|
||
|
|
|
||
|
|
#### system_config.k (7,020 bytes)
|
||
|
|
- **Purpose**: System-level configuration and management
|
||
|
|
- **Defines**:
|
||
|
|
- System-wide settings
|
||
|
|
- Configuration inheritance
|
||
|
|
- System state management
|
||
|
|
- System validation rules
|
||
|
|
- **Status**: Updated (2025-12-11)
|
||
|
|
|
||
|
|
#### oci_registry.k (13,128 bytes)
|
||
|
|
- **Purpose**: OCI (Open Container Initiative) registry configuration
|
||
|
|
- **Includes**:
|
||
|
|
- Registry authentication schemas
|
||
|
|
- Image push/pull configurations
|
||
|
|
- Registry security policies
|
||
|
|
- Registry lifecycle management
|
||
|
|
- **Status**: Updated (2025-12-11)
|
||
|
|
|
||
|
|
#### nested_provisioning.k (12,077 bytes)
|
||
|
|
- **Purpose**: Nested and recursive provisioning configurations
|
||
|
|
- **Defines**:
|
||
|
|
- Nested infrastructure definitions
|
||
|
|
- Recursive provisioning schemas
|
||
|
|
- Multi-level infrastructure management
|
||
|
|
- Nested state synchronization
|
||
|
|
- **Status**: Updated (2025-12-11)
|
||
|
|
|
||
|
|
### Workflow Schemas
|
||
|
|
|
||
|
|
#### workflows.k (10,107 bytes)
|
||
|
|
- **Purpose**: Infrastructure automation workflow definitions
|
||
|
|
- **Provides**:
|
||
|
|
- Workflow schema definitions
|
||
|
|
- Task composition schemas
|
||
|
|
- Workflow validation rules
|
||
|
|
- Workflow execution models
|
||
|
|
- **Status**: Stable
|
||
|
|
|
||
|
|
#### batch.k (9,524 bytes)
|
||
|
|
- **Purpose**: Batch operation utilities and schemas
|
||
|
|
- **Includes**:
|
||
|
|
- Batch operation definitions
|
||
|
|
- Batch processing schemas
|
||
|
|
- Batch validation and constraints
|
||
|
|
- Batch result handling
|
||
|
|
- **Status**: Stable
|
||
|
|
|
||
|
|
#### commands.k (11,839 bytes)
|
||
|
|
- **Purpose**: Command definition and validation schemas
|
||
|
|
- **Defines**:
|
||
|
|
- Command schemas
|
||
|
|
- Command argument validation
|
||
|
|
- Command execution models
|
||
|
|
- Command result handling
|
||
|
|
- **Status**: Updated (2025-12-11)
|
||
|
|
|
||
|
|
#### k8s_deploy.k (7,262 bytes)
|
||
|
|
- **Purpose**: Kubernetes deployment and management schemas
|
||
|
|
- **Includes**:
|
||
|
|
- Deployment resource schemas
|
||
|
|
- Pod configuration schemas
|
||
|
|
- Service definitions
|
||
|
|
- Ingress configurations
|
||
|
|
- **Status**: Updated (2025-12-11)
|
||
|
|
|
||
|
|
### Configuration Management
|
||
|
|
|
||
|
|
#### workspace_config.k (7,853 bytes)
|
||
|
|
- **Purpose**: Workspace-level configuration schemas
|
||
|
|
- **Defines**:
|
||
|
|
- Workspace configuration structure
|
||
|
|
- Workspace validation rules
|
||
|
|
- Workspace inheritance models
|
||
|
|
- Workspace state management
|
||
|
|
- **Status**: Updated (2025-12-05)
|
||
|
|
|
||
|
|
#### workspace_config_defaults.k (3,553 bytes)
|
||
|
|
- **Purpose**: Default workspace configurations
|
||
|
|
- **Provides**:
|
||
|
|
- Workspace default values
|
||
|
|
- Configuration templates
|
||
|
|
- Default inheritance patterns
|
||
|
|
- Standard workspace setups
|
||
|
|
- **Status**: Updated (2025-12-05)
|
||
|
|
|
||
|
|
### Additional Schemas
|
||
|
|
|
||
|
|
#### coredns.k (13,077 bytes)
|
||
|
|
- **Purpose**: CoreDNS configuration and management
|
||
|
|
- **Includes**:
|
||
|
|
- DNS configuration schemas
|
||
|
|
- DNS record definitions
|
||
|
|
- DNS policy enforcement
|
||
|
|
- DNS service configurations
|
||
|
|
- **Status**: Updated (2025-12-11)
|
||
|
|
|
||
|
|
#### gitea.k (8,395 bytes)
|
||
|
|
- **Purpose**: Gitea git service integration and configuration
|
||
|
|
- **Defines**:
|
||
|
|
- Gitea instance schemas
|
||
|
|
- Repository configurations
|
||
|
|
- User and access management
|
||
|
|
- Gitea integration points
|
||
|
|
- **Status**: Stable (updated 2025-10-06)
|
||
|
|
|
||
|
|
#### examples_batch.k (15,685 bytes)
|
||
|
|
- **Purpose**: Comprehensive batch operation examples
|
||
|
|
- **Provides**:
|
||
|
|
- Real-world workflow examples
|
||
|
|
- Multi-cloud deployment examples
|
||
|
|
- Complex configuration samples
|
||
|
|
- Best practice demonstrations
|
||
|
|
- **Status**: Updated (2025-12-11)
|
||
|
|
|
||
|
|
### Supporting Structures
|
||
|
|
|
||
|
|
#### docs/ directory
|
||
|
|
- **Purpose**: KCL package documentation
|
||
|
|
- **Contains**:
|
||
|
|
- Schema documentation
|
||
|
|
- Usage examples
|
||
|
|
- Integration guides
|
||
|
|
- Best practices
|
||
|
|
- **Status**: Active
|
||
|
|
|
||
|
|
#### examples/ directory (9 files)
|
||
|
|
- **Purpose**: Example configurations and workflows
|
||
|
|
- **Includes**:
|
||
|
|
- Batch workflow examples
|
||
|
|
- Server configurations
|
||
|
|
- Cluster setups
|
||
|
|
- Integration examples
|
||
|
|
- **Status**: Updated (2025-12-11)
|
||
|
|
|
||
|
|
#### generator/ directory
|
||
|
|
- **Purpose**: Code generation from KCL schemas
|
||
|
|
- **Provides**:
|
||
|
|
- Schema-to-code generation
|
||
|
|
- Configuration validation generators
|
||
|
|
- Type definition generators
|
||
|
|
- Documentation generators
|
||
|
|
- **Status**: Active
|
||
|
|
|
||
|
|
#### integrations/ directory
|
||
|
|
- **Purpose**: Integration with external systems
|
||
|
|
- **Includes**:
|
||
|
|
- Third-party integrations
|
||
|
|
- API schema definitions
|
||
|
|
- Service integration patterns
|
||
|
|
- Cross-system validation
|
||
|
|
- **Status**: Updated (2025-12-11)
|
||
|
|
|
||
|
|
### Module Configuration
|
||
|
|
|
||
|
|
#### kcl.mod
|
||
|
|
- **Purpose**: KCL module definition and dependencies
|
||
|
|
- **Status**: Configured
|
||
|
|
|
||
|
|
#### kcl.mod.lock (Empty)
|
||
|
|
- **Purpose**: Locked dependency versions
|
||
|
|
- **Status**: Not yet populated
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 📊 Statistics
|
||
|
|
|
||
|
|
| Category | Files | Status |
|
||
|
|
|----------|-------|--------|
|
||
|
|
| Core Schemas | 5 | Stable |
|
||
|
|
| Infrastructure | 11 | Updated |
|
||
|
|
| Workflows | 4 | Stable |
|
||
|
|
| Configuration | 2 | Updated |
|
||
|
|
| Examples & Docs | 3 | Updated |
|
||
|
|
| Generators | 1 | Active |
|
||
|
|
| Integrations | 1 | Active |
|
||
|
|
|
||
|
|
**Total KCL Modules**: 27+
|
||
|
|
**Total Lines**: 150,000+ (estimated)
|
||
|
|
**Documentation Files**: 2 (README.md, REFERENCE.md)
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 🔄 Recent Updates (2025-12-11)
|
||
|
|
|
||
|
|
### Infrastructure Schemas Updated
|
||
|
|
- `modes.k` - Deployment mode configurations
|
||
|
|
- `golden_image.k` - Image management
|
||
|
|
- `vm.k` - Virtual machine configs
|
||
|
|
- `vm_lifecycle.k` - VM lifecycle management
|
||
|
|
- `system_config.k` - System configuration
|
||
|
|
- `oci_registry.k` - Container registry
|
||
|
|
- `nested_provisioning.k` - Nested provisioning
|
||
|
|
- `services.k` - Taskserv management
|
||
|
|
- `settings.k` - Core settings
|
||
|
|
- `commands.k` - Command schemas
|
||
|
|
- `coredns.k` - DNS management
|
||
|
|
- `k8s_deploy.k` - Kubernetes deployments
|
||
|
|
- `examples_batch.k` - Batch examples
|
||
|
|
|
||
|
|
### Features Enhanced
|
||
|
|
- ✅ Type-safe schema definitions
|
||
|
|
- ✅ Comprehensive validation rules
|
||
|
|
- ✅ Multi-cloud support (provider-agnostic)
|
||
|
|
- ✅ Kubernetes-native configurations
|
||
|
|
- ✅ Nested provisioning support
|
||
|
|
- ✅ Batch workflow orchestration
|
||
|
|
- ✅ System configuration management
|
||
|
|
- ✅ Workspace isolation support
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 🎯 Key Capabilities
|
||
|
|
|
||
|
|
### Infrastructure as Code
|
||
|
|
- Type-safe infrastructure definitions using KCL
|
||
|
|
- Provider-agnostic configurations (UpCloud, AWS, local)
|
||
|
|
- Semantic validation for all configurations
|
||
|
|
- Hierarchical configuration inheritance
|
||
|
|
|
||
|
|
### Batch Operations
|
||
|
|
- Multi-provider batch workflow support
|
||
|
|
- Dependency resolution and topological sorting
|
||
|
|
- Checkpoint-based recovery
|
||
|
|
- State management and rollback capabilities
|
||
|
|
|
||
|
|
### Kubernetes Integration
|
||
|
|
- Native Kubernetes manifest generation
|
||
|
|
- Service mesh and networking configurations
|
||
|
|
- StatefulSet and Deployment support
|
||
|
|
- Ingress and network policy definitions
|
||
|
|
|
||
|
|
### Configuration Management
|
||
|
|
- Hierarchical configuration loading
|
||
|
|
- Configuration validation schemas
|
||
|
|
- Default value management
|
||
|
|
- Environment-specific overrides
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## ✨ Integration Points
|
||
|
|
|
||
|
|
- **CLI System**: Provides schemas for command definitions and validation
|
||
|
|
- **Nushell Library**: Type definitions exported for use in Nushell scripts
|
||
|
|
- **Orchestrator**: Workflow schema validation and execution
|
||
|
|
- **Plugins**: Schema definitions for plugin configurations
|
||
|
|
- **Platform Services**: Configuration schemas for all platform components
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 🚀 Backward Compatibility
|
||
|
|
|
||
|
|
**✅ 100% Backward Compatible**
|
||
|
|
|
||
|
|
All changes maintain compatibility with existing KCL configurations:
|
||
|
|
- Schema additions are non-breaking
|
||
|
|
- Default values preserve existing behavior
|
||
|
|
- Validation rules are additive only
|
||
|
|
- No removal of existing schemas or properties
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 📚 Documentation
|
||
|
|
|
||
|
|
- **README.md** - Package overview and quick start guide
|
||
|
|
- **REFERENCE.md** - Schema reference documentation
|
||
|
|
- **docs/** - Detailed documentation and guides
|
||
|
|
- **examples/** - Real-world configuration examples
|
||
|
|
- **integrations/** - Integration with external systems
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 🔐 Type Safety
|
||
|
|
|
||
|
|
All schemas include:
|
||
|
|
- Explicit type definitions
|
||
|
|
- Comprehensive validation rules
|
||
|
|
- Constraint checking
|
||
|
|
- Error reporting with context
|
||
|
|
- Documentation of expected values
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
## 🛠️ Development
|
||
|
|
|
||
|
|
### Using KCL Schemas
|
||
|
|
|
||
|
|
```kcl
|
||
|
|
# Import main package
|
||
|
|
import provisioning.main as prov
|
||
|
|
|
||
|
|
# Define infrastructure
|
||
|
|
server: prov.ServerConfig = {
|
||
|
|
name = "web-01"
|
||
|
|
plan = "1xCPU-2GB"
|
||
|
|
zone = "de-fra1"
|
||
|
|
operating_system = "ubuntu-22.04"
|
||
|
|
}
|
||
|
|
|
||
|
|
# Define workflow
|
||
|
|
workflow: prov.BatchWorkflow = {
|
||
|
|
name = "deploy_servers"
|
||
|
|
operations = [
|
||
|
|
{
|
||
|
|
type = "server_create"
|
||
|
|
servers = [server]
|
||
|
|
}
|
||
|
|
]
|
||
|
|
}
|
||
|
|
```
|
||
|
|
|
||
|
|
### Validation
|
||
|
|
|
||
|
|
All configurations are validated at:
|
||
|
|
1. **Schema Level** - Type checking and constraint validation
|
||
|
|
2. **Semantic Level** - Cross-schema relationship validation
|
||
|
|
3. **Execution Level** - Runtime validation before execution
|
||
|
|
|
||
|
|
---
|
||
|
|
|
||
|
|
**Status**: All KCL schemas stable and production-ready
|
||
|
|
**Last Updated**: 2025-12-11
|
||
|
|
**Repository**: provisioning/kcl
|