provisioning/config/templates/workspace-config-schema.k.template
Jesús Pérez 6a59d34bb1
chore: update provisioning configuration and documentation
Update configuration files, templates, and internal documentation
for the provisioning repository system.

Configuration Updates:
- KMS configuration modernization
- Plugin system settings
- Service port mappings
- Test cluster topologies
- Installation configuration examples
- VM configuration defaults
- Cedar authorization policies

Documentation Updates:
- Library module documentation
- Extension API guides
- AI system documentation
- Service management guides
- Test environment setup
- Plugin usage guides
- Validator configuration documentation

All changes are backward compatible.
2025-12-11 21:50:42 +00:00

310 lines
8.3 KiB
Plaintext

"""
TEMPLATE FILE - .template Extension
Workspace Configuration Schema
Defines the complete structure for workspace configuration in KCL format.
This is the Single Source of Truth (SST) for workspace configuration schemas.
This file uses the .template extension because it's used only during workspace
initialization with simple {{variable}} substitution. It's copied to all new
workspaces without modification.
Runtime templates use .j2 (Jinja2 via nu_plugin_tera) for dynamic rendering.
This schema provides:
- Workspace metadata and versioning
- Path definitions for all workspace resources
- Debug and output settings
- Provider and platform configuration
- Secrets and KMS management
- SSH and tool settings
- Cache and generation settings
All workspaces inherit this schema and validate against it.
See provisioning/config/templates/README.md for template conventions.
"""
import regex
# ============================================================================
# Workspace Metadata
# ============================================================================
schema Workspace:
"""Workspace identification and versioning"""
name: str
version: str
created: str
check:
len(name) > 0, "Workspace name required"
regex.match(version, r"^\d+\.\d+\.\d+$"), \
"Version must be semantic versioning (e.g., 1.0.0)"
# ============================================================================
# Path Configuration
# ============================================================================
schema Paths:
"""Path definitions for all workspace resources"""
base: str
infra: str
cache: str
runtime: str
providers: str
taskservs: str
clusters: str
orchestrator: str
control_center: str
kms: str
generate: str
run_clusters: str
run_taskservs: str
extensions: str
resources: str
templates: str
tools: str
# ============================================================================
# Provisioning System Configuration
# ============================================================================
schema ProvisioningConfig:
"""Provisioning system path and identification"""
path: str
schema CoreConfig:
"""Core provisioning settings"""
version: str
name: str
# ============================================================================
# Debug and Output Settings
# ============================================================================
schema DebugConfig:
"""Debug settings and verbosity control"""
enabled: bool
metadata: bool
check_mode: bool
validation: bool
remote: bool
log_level: str
no_terminal: bool
schema OutputConfig:
"""Output format and display settings"""
file_viewer: str
format: str
# ============================================================================
# HTTP Client Configuration
# ============================================================================
schema HttpConfig:
"""HTTP client settings"""
use_curl: bool
timeout: int
check:
timeout > 0, "Timeout must be positive"
# ============================================================================
# Provider Configuration
# ============================================================================
schema ProviderConfig:
"""Provider configuration and defaults"""
active: [str]
default: str
# ============================================================================
# Platform Services Configuration
# ============================================================================
schema PlatformConfig:
"""Platform services enablement"""
orchestrator_enabled: bool
control_center_enabled: bool
mcp_enabled: bool
# ============================================================================
# Secrets Management Configuration
# ============================================================================
schema SecretsConfig:
"""Secrets management configuration"""
provider: str
sops_enabled: bool
kms_enabled: bool
# ============================================================================
# KMS Configuration
# ============================================================================
schema KmsConfig:
"""KMS (Key Management System) configuration"""
mode: str
config_file: str
# ============================================================================
# SOPS Configuration
# ============================================================================
schema SopsConfig:
"""SOPS (Secrets Operations) configuration"""
use_sops: bool
config_path: str
key_search_paths: [str]
# ============================================================================
# AI Configuration
# ============================================================================
schema AiConfig:
"""AI service configuration"""
enabled: bool
provider: str
config_path: str
# ============================================================================
# Task Services Configuration
# ============================================================================
schema TaskservsConfig:
"""Task services runtime configuration"""
run_path: str
# ============================================================================
# Clusters Configuration
# ============================================================================
schema ClustersConfig:
"""Clusters runtime configuration"""
run_path: str
# ============================================================================
# Generation Configuration
# ============================================================================
schema GenerationConfig:
"""Code/manifest generation settings"""
dir_path: str
defs_file: str
# ============================================================================
# Cache Configuration
# ============================================================================
schema CacheConfig:
"""Caching configuration"""
enabled: bool
path: str
infra_cache: str
grace_period: int
check_updates: bool
max_cache_size: str
check:
grace_period > 0, "Grace period must be positive"
# ============================================================================
# Infrastructure Context
# ============================================================================
schema InfraConfig:
"""Infrastructure context settings"""
current: str
# ============================================================================
# Tools Configuration
# ============================================================================
schema ToolsConfig:
"""Tool detection and plugin settings"""
use_kcl: bool
use_kcl_plugin: bool
use_tera_plugin: bool
# ============================================================================
# KCL Module Configuration
# ============================================================================
schema KclConfig:
"""KCL module and package configuration"""
core_module: str
core_version: str
core_package_name: str
use_module_loader: bool
module_loader_path: str
modules_dir: str
# ============================================================================
# SSH Configuration
# ============================================================================
schema SshConfig:
"""SSH client configuration"""
user: str
options: [str]
timeout: int
debug: bool
check:
timeout > 0, "Timeout must be positive"
# ============================================================================
# Main Workspace Configuration
# ============================================================================
schema WorkspaceConfig:
"""Complete workspace configuration"""
workspace: Workspace
paths: Paths
provisioning: ProvisioningConfig
core: CoreConfig
debug: DebugConfig
output: OutputConfig
http: HttpConfig
providers: ProviderConfig
platform: PlatformConfig
secrets: SecretsConfig
kms: KmsConfig
sops: SopsConfig
ai: AiConfig
taskservs: TaskservsConfig
clusters: ClustersConfig
generation: GenerationConfig
cache: CacheConfig
infra: InfraConfig
tools: ToolsConfig
kcl: KclConfig
ssh: SshConfig
check:
len(workspace.name) > 0, "Workspace name required"
len(paths.base) > 0, "Base path required"