Expand description
spec.seed — initialize a brand-new repository from an existing replica
(issue #380).
Disaster recovery starts with an empty cluster and a full off-site mirror.
Without this block the only way to get the mirror’s history back under
kopiur’s management is to point a Repository at the mirror itself (which
then becomes the live repository the new cluster writes into) or to copy the
blobs by hand. spec.seed makes the first bootstrap of an uninitialized
backend pull the data across first, in one mover Job, before the repository
is ever reported Ready.
Two source shapes, one field:
SeedSource::Backend— blob mode: a bare storage backend holding a byte-for-byte mirror of a kopia repository (what aRepositoryReplicationwrites). The copy iskopia repository sync-to, so the new repository inherits the mirror’s format and password verbatim — this repository’s ownencryption.passwordSecretRefmust therefore already carry the mirror’s password.SeedSource::Repository— migrate mode: anotherRepositoryorClusterRepositoryCR, opened read-only. The copy iskopia snapshot migrate, which preserves each snapshot’susername@hostname:pathidentity and times, so seeded history stays restorable byidentity/fromPolicy. Source and destination are two real repositories with their own passwords and formats.
Not to be confused with the “seed job” fixtures in deploy/examples — those
are one-shot Jobs that write test data into a volume. This block seeds a
repository, from another repository.
Seeding is armed only while the repository has never been initialized
(status.uniqueId unset) AND the mover’s first connect reports the backend
uninitialized. On an already-initialized repository the block is a documented
no-op (Seeded=True, reason AlreadyInitialized), so it is safe to leave
standing in a GitOps manifest forever.
Structs§
- Seed
Migrate Options - Migrate-mode tuning for
kopia snapshot migrate. - Seed
Spec - Initialize this repository from an existing replica on its first bootstrap.
- Seed
Status - What the last seed attempt did, pinned on
Repository/ClusterRepositorystatus.seed. Absent on a repository that was never seeded. - Seed
Sync Options - Blob-mode tuning for
kopia repository sync-to.
Enums§
- Seed
Mode - Which copy mechanism a seed ran. Mirrors the
SeedSourcevariant, named after the operation rather than the input so status, metrics (kopiur_repository_seed_total{mode}) and docs share one vocabulary. - Seed
Source - Where a seed reads from — exactly one of, externally tagged
(
from: { backend: { s3: {...} } }orfrom: { repository: {...} }).
Constants§
- DEFAULT_
SEED_ BOOTSTRAP_ DEADLINE_ SECS - Default
activeDeadlineSecondsfor a bootstrap Job that is seeding — 24 hours, versus the 120s a routine connect gets.
Functions§
- seed_
active_ deadline_ seconds - The
activeDeadlineSecondsa seeding bootstrap Job gets: the repository’s ownspec.seed.failurePolicy.activeDeadlineSeconds, elseDEFAULT_SEED_BOOTSTRAP_DEADLINE_SECS. - seed_
armed - Whether a repository whose
status.uniqueIdisunique_idshould arm its seed (D4): a seed runs only on a repository that has never been initialized. Once the bootstrap pins a unique ID the block is a standing no-op. - seed_
backend - The
Backenda blob-mode seed reads from, orNonefor migrate mode. Exhaustive counterpart toseed_repository_ref. - seed_
repository_ ref - The
RepositoryRefa migrate-mode seed reads from, orNonefor blob mode. Exhaustive helper so callers that only care about the CR-reference case (referent watches, tenancy gates, credential resolution) do not each write their ownmatch. - seed_
resume - Whether an armed seed must RESUME an attempt a previous bootstrap started but did not finish, rather than run as a first seed.