provisioning/docs/src/operations/service-management-guide.md

2 lines
28 KiB
Markdown
Raw Normal View History

# Service Management Guide\n\n**Version**: 1.0.0\n**Last Updated**: 2025-10-06\n\n## Table of Contents\n\n1. [Overview](#overview)\n2. [Service Architecture](#service-architecture)\n3. [Service Registry](#service-registry)\n4. [Platform Commands](#platform-commands)\n5. [Service Commands](#service-commands)\n6. [Deployment Modes](#deployment-modes)\n7. [Health Monitoring](#health-monitoring)\n8. [Dependency Management](#dependency-management)\n9. [Pre-flight Checks](#pre-flight-checks)\n10. [Troubleshooting](#troubleshooting)\n\n---\n\n## Overview\n\nThe Service Management System provides comprehensive lifecycle management for all platform services (orchestrator, control-center, CoreDNS, Gitea, OCI\nregistry, MCP server, API gateway).\n\n### Key Features\n\n- **Unified Service Management**: Single interface for all services\n- **Automatic Dependency Resolution**: Start services in correct order\n- **Health Monitoring**: Continuous health checks with automatic recovery\n- **Multiple Deployment Modes**: Binary, Docker, Docker Compose, Kubernetes, Remote\n- **Pre-flight Checks**: Validate prerequisites before operations\n- **Service Registry**: Centralized service configuration\n\n### Supported Services\n\n| Service | Type | Category | Description |\n| --------- | ------ | ---------- | ------------- |\n| orchestrator | Platform | Orchestration | Rust-based workflow coordinator |\n| control-center | Platform | UI | Web-based management interface |\n| coredns | Infrastructure | DNS | Local DNS resolution |\n| gitea | Infrastructure | Git | Self-hosted Git service |\n| oci-registry | Infrastructure | Registry | OCI-compliant container registry |\n| mcp-server | Platform | API | Model Context Protocol server |\n| api-gateway | Platform | API | Unified REST API gateway |\n\n---\n\n## Service Architecture\n\n### System Architecture\n\n```\n┌─────────────────────────────────────────┐\n│ Service Management CLI │\n│ (platform/services commands) │\n└─────────────────┬───────────────────────┘\n │\n ┌──────────┴──────────┐\n │ │\n ▼ ▼\n┌──────────────┐ ┌───────────────┐\n│ Manager │ │ Lifecycle │\n│ (Core) │ │ (Start/Stop)│\n└──────┬───────┘ └───────┬───────┘\n │ │\n ▼ ▼\n┌──────────────┐ ┌───────────────┐\n│ Health │ │ Dependencies │\n│ (Checks) │ │ (Resolution) │\n└──────────────┘ └───────────────┘\n │ │\n └────────┬───────────┘\n │\n ▼\n ┌────────────────┐\n │ Pre-flight │\n │ (Validation) │\n └────────────────┘\n```\n\n### Component Responsibilities\n\n**Manager** (`manager.nu`)\n\n- Service registry loading\n- Service status tracking\n- State persistence\n\n**Lifecycle** (`lifecycle.nu`)\n\n- Service start/stop operations\n- Deployment mode handling\n- Process management\n\n**Health** (`health.nu`)\n\n- Health check execution\n- HTTP/TCP/Command/File checks\n- Continuous monitoring\n\n**Dependencies** (`dependencies.nu`)\n\n- Dependency graph analysis\n- Topological sorting\n- Startup order calculation\n\n**Pre-flight** (`preflight.nu`)\n\n- Prerequisite validation\n- Conflict detection\n- Auto-start orchestration\n\n---\n\n## Service Registry\n\n### Configuration File\n\n**Locat