3.2 KiB
3.2 KiB
Infrastructure Standards
This document defines the standards and conventions for the homelab GitOps-lite environment.
Host Architecture
| Host | Role | Description |
|---|---|---|
| SATURN | Primary Node | Development, orchestration, and git source of truth (commit node). |
| SOLARIA | Compute Node | GPU, inference, and heavy compute workloads. |
| PIHA | Infra Node | Core infrastructure services, automation, and monitoring. |
| VPS | Edge Node | Public ingress, reverse proxy, and edge services. |
Directory Layout
Repository Layout
/
├── docs/ # Infrastructure documentation
├── hosts/ # Host-specific configurations
├── inventory/ # Topology and templates
├── services/ # Normalized service definitions
│ └── <service>/
│ ├── docker-compose.yml
│ ├── service.yaml
│ ├── README.md
│ ├── env.example
│ └── healthcheck.sh
├── scripts/ # Management and deployment scripts
└── README.md
Runtime Layout (on Execution Nodes)
Runtime state must live outside the repository to keep it immutable and clean.
/opt/homelab/
├── services/ # Active docker-compose files (deployed from git)
├── data/ # Persistent volume data (backed up)
├── config/ # Host-local overrides and secrets (not in git)
│ └── <service>/
│ ├── .env # Merged environment variables
│ └── overrides/ # Local configuration overrides
└── logs/ # Service logs
Service Standards
- Normalization: Every service MUST follow the
services/<service>/layout. - Metadata: Every service MUST have a
service.yamldefining its operational contract. This is the primary source of truth for AI agents. - Healthchecks: Every service MUST have a
healthcheck.shfor verification. Agents use this to emit stability events. - Actionability: Any automated recovery action proposed by an agent must be backed by a
service.yamldefinition. - Secrets: NEVER commit secrets to Git. Use
env.exampleas a template and populate/opt/homelab/config/<service>/.envon the host. Agents must treat these as "black box" configurations.
Docker Compose Standards
- File Naming: Use
docker-compose.yml. - Container Naming: Match the service name.
- Restarts: Always use
restart: unless-stoppedunless specified otherwise inservice.yaml. - Networking:
- Use
tailscaleinternal mesh for inter-host communication. - Expose ports only when necessary.
- Use
- Volumes: Use absolute paths to
/opt/homelab/data/<service>.
Environment Variables
.env: Default environment variables (checked into git if safe)..env.local: Host-specific overrides (not in git).
Naming Conventions
- Hosts: All caps (SATURN, SOLARIA, PIHA, VPS).
- Services: Kebab-case (e.g.,
ollama-server). - Containers: Match service name.
Deployment Flow
- Changes are committed and pushed to SATURN.
- Execution nodes (SOLARIA, PIHA, VPS) pull changes.
- Deployment scripts trigger
docker compose up -d.