my-homelab-configs/bootstrap/apps/README.md

51 lines
2.8 KiB
Markdown

# Registry discovery and retained-data migration
`./jeannie apps` and `./jeannie apps container-registry` reconcile registry
storage before updating the Argo Application. This uses pinned cluster identity,
live nodes/PVs and the existing worker inventory, rather than a profile-specific
manifest directory.
Existing local PVs retain their node, path and resource names. A fresh cluster
with the old registry worker still present uses that worker. A fresh single-node
cluster on the deployment host instead prepares its local retained directory.
An existing PV pointing to a missing node is refused rather than rewritten.
For the local destination, Jeannie inspects the previous registry worker over
SSH. If the worker is stopped, it checks its Proxmox VMID and name, temporarily
starts only that VM, and restores its stopped state with a graceful shutdown.
It does not start the old control plane. Failure to reach or inspect the source
blocks deployment; it is not treated as missing registry data.
If source data exists, it is copied into a new staging directory after a disk
capacity check. Source manifests before/after the copy and the copied files must
have identical SHA-256 checksums. Changed source data, special files, failed
transfers or verification errors stop publication. Staging directories are
retained for investigation, and source data is never removed. If source
inspection confirms an absent or empty directory, an empty retained destination
is prepared instead. Unrecorded, nonempty destination directories are refused
instead of overwritten or merged.
Successful copies write a profile-scoped `registry-migration.json` receipt.
Subsequent runs preserve existing destination data. The storage and deployment
placement are passed to Argo through `registry_placement` Kustomize patches;
the scheduling preflight renders those same patches. Legacy PV/PVC names remain
stable to preserve existing Pimox deployments.
When serving locally, only firewall rules bearing Jeannie's exact
`homelab-pimox-registry-forward` comment are retired, together with the matching
forwarding service. If the local runtime is k3s, its registry configuration is
merged with the HTTP mirror needed for the existing registry endpoint. Existing
configuration is backed up; custom mirror endpoints are refused. The first
configuration change restarts k3s and waits for API readiness. Repeat runs avoid
that restart.
Discovery overrides, when inventory uses different locations:
- `LAB_PIMOX_REGISTRY_STORAGE_PATH`: previous registry directory.
- `LAB_REGISTRY_STORAGE_PATH`: local destination directory.
- `LAB_PIMOX_REGISTRY_SOURCE_VMID`: source VMID (defaults to worker base VMID).
Registry paths must be specific directories below `/data`. Migration requires
passwordless sudo on the destination, source worker and Proxmox host. This is a
copy, not ongoing replication or failover between registries.