diff --git a/kb/runbooks/service-operational-recovery.md b/kb/runbooks/service-operational-recovery.md new file mode 100644 index 0000000..c47265d --- /dev/null +++ b/kb/runbooks/service-operational-recovery.md @@ -0,0 +1,31 @@ +--- +okf: "0.1" +type: runbook +visibility: private +status: active +updated: 2026-05-11 +links: + - ../subsystems/service-lifecycle.md +--- + +# Serwisy — operational recovery + +## Operational Recovery + +### 1. Container Failure +If a service is unhealthy: +- Check `docker compose logs`. +- Restart: `docker compose restart`. +- Recreate: `docker compose up -d --force-recreate`. + +### 2. Node Failure +If a host node fails: +- Services with `owner_node` matching the failed node must be recovered on a backup node or the node must be restored. +- Persistence data must be restored from backups to `/opt/homelab/data/`. + +### 3. Dependency Recovery +If a dependency fails: +- Services depending on it might report unhealthy status. +- Recover the dependency first. +- Re-verify dependent services. + diff --git a/docs/lifecycle.md b/kb/subsystems/service-lifecycle.md similarity index 70% rename from docs/lifecycle.md rename to kb/subsystems/service-lifecycle.md index 06c7493..917f515 100644 --- a/docs/lifecycle.md +++ b/kb/subsystems/service-lifecycle.md @@ -1,3 +1,13 @@ +--- +okf: "0.1" +type: subsystem +visibility: private +status: active +updated: 2026-05-11 +links: + - ../runbooks/service-operational-recovery.md +--- + # Service Lifecycle and Recovery This document defines the lifecycle of a service in the homelab and the procedures for operational recovery. @@ -25,25 +35,6 @@ This document defines the lifecycle of a service in the homelab and the procedur - `docker compose down`. - Archive `/opt/homelab/data/` if necessary. -## Operational Recovery - -### 1. Container Failure -If a service is unhealthy: -- Check `docker compose logs`. -- Restart: `docker compose restart`. -- Recreate: `docker compose up -d --force-recreate`. - -### 2. Node Failure -If a host node fails: -- Services with `owner_node` matching the failed node must be recovered on a backup node or the node must be restored. -- Persistence data must be restored from backups to `/opt/homelab/data/`. - -### 3. Dependency Recovery -If a dependency fails: -- Services depending on it might report unhealthy status. -- Recover the dependency first. -- Re-verify dependent services. - ## Persistent Data Conventions - **Data**: `/opt/homelab/data/` - Primary persistent state.