Kind
Snapshot
Group
kopiur.home-operations.com
Version
v1alpha1
apiVersion: kopiur.home-operations.com/v1alpha1 kind: Snapshot metadata: name: example
Tip: use .spec.deletionPolicy for path-only search
View raw schema
spec object required
A single kopia snapshot represented as a Kubernetes object. ADR §3.4. For `scheduled`/`manual` backups the spec carries `policyRef` (+ optional overrides). For `discovered` backups the spec is empty — every field is optional.
deletionPolicy string
Lifecycle of the underlying kopia snapshot when its `Snapshot` CR is deleted. Shared by `SnapshotPolicy.spec.defaultDeletionPolicy` and `Snapshot.spec.deletionPolicy`. ADR-0003 §4.5 / ADR-0001 §4.5. The reconciler distinguishes the three cases with an exhaustive `match` — Rust enforces that any new variant added later must be handled in every match site, preventing the class of bug where a new policy slips into production without a corresponding reconcile branch. ``` use kopiur_api::common::DeletionPolicy; // Produced backups default to deleting the snapshot with the CR. assert_eq!(DeletionPolicy::default(), DeletionPolicy::Delete); // Variants serialize to their bare PascalCase names (plain string enum). assert_eq!(serde_json::to_value(DeletionPolicy::Retain).unwrap(), "Retain"); assert_eq!(serde_json::to_value(DeletionPolicy::Orphan).unwrap(), "Orphan"); ```
enum: Delete, Retain, Orphan
failurePolicy object
Per-run failure controls passed to the mover `Job`. ADR §3.4 (G6).
activeDeadlineSeconds integer
Passed through to the mover `Job.spec.activeDeadlineSeconds` — wall-clock cap after which a still-running run is killed.
format: int64
backoffLimit integer
Passed through to the mover `Job.spec.backoffLimit` — how many times a failed run is retried before the Job is marked failed.
format: int32
pin boolean
Pin this snapshot to exempt it from GFS retention (ADR-0005 §13(c)). When `true` the reconciler applies a kopia snapshot pin and the GFS pruner never selects it for deletion — for pre-migration / compliance holds. Clearing it removes the pin. Default `false`.
policyRef object
The recipe to run. Absent for `discovered` backups. ADR §3.4.
name string required
Name of the referenced `SnapshotPolicy`.
namespace string
Namespace of the `SnapshotPolicy`; absent = same namespace as the referrer.
tags object
Arbitrary kopia snapshot tags (e.g. `reason: scheduled-nightly`). ADR §3.4.
status object
Observed state of a [`Snapshot`]. ADR §3.4 status.
conditions []object
Standard Kubernetes conditions (e.g. `SourcesQuiesced`, `SnapshotCreated`). ADR §3.4 status.
lastTransitionTime string required
lastTransitionTime is the last time the condition transitioned from one status to another. This should be when the underlying condition changed. If that is not known, then using the time when the API field changed is acceptable.
format: date-time
message string required
message is a human readable message indicating details about the transition. This may be an empty string.
observedGeneration integer
observedGeneration represents the .metadata.generation that the condition was set based upon. For instance, if .metadata.generation is currently 12, but the .status.conditions[x].observedGeneration is 9, the condition is out of date with respect to the current state of the instance.
format: int64
reason string required
reason contains a programmatic identifier indicating the reason for the condition's last transition. Producers of specific condition types may define expected values and meanings for this field, and whether the values are considered a guaranteed API. The value should be a CamelCase string. This field may not be empty.
status string required
status of the condition, one of True, False, Unknown.
type string required
type of condition in CamelCase or in foo.example.com/CamelCase.
failure object
Structured terminal-failure detail (kopia error class, stderr tail, retry hint), written by the mover before it exits non-zero. ADR §4.10.
exitCode integer
The process exit code, if one was reported.
format: int32
kopiaErrorClass string required
kopia error class (e.g. `RepositoryUnavailable`, `AuthFailure`).
message string required
A short human-readable message: what failed, why, and how to fix it.
retryRecommended boolean required
Whether retrying the same operation unchanged could succeed.
stderrTail string
The last lines of kopia's stderr, if any were captured (bounded by [`MAX_LOG_TAIL_BYTES`]).
hooks object
Hook-execution bookkeeping (ADR §4.8): completion timestamps the reconciler stamps so each hook list runs exactly once per Snapshot across requeues and controller restarts (hooks have side effects — quiesce, resume — that must not repeat).
postCompletedAt string
When the `afterSnapshot` list completed (RFC3339); absent until it has.
preCompletedAt string
When the `beforeSnapshot` list completed (RFC3339); absent until it has.
job object
Present for scheduled/manual; absent for discovered. ADR §3.4.
attempts integer
Number of attempts so far (bounded by `failurePolicy.backoffLimit`). ADR §3.4 status.
format: int32
name string
Name of the mover `Job`. ADR §3.4 status.
logTail string
The last lines of the run's output, written by the mover at the terminal transition (success: the `Snapshot created: <id>` line; failure: the actionable error + kopia stderr tail). Capped at [`crate::common::MAX_LOG_TAIL_BYTES`]; full logs live in the Job pod. ADR §3.4/§4.10.
observedGeneration integer
`metadata.generation` last reconciled, for staleness detection. ADR §3.4 status.
format: int64
origin string
How a `Snapshot` came to exist. Canonical value mirrored from the `kopiur.home-operations.com/origin` label. Closed enum. ADR §3.4. Origin drives the deletion-policy default (ADR §4.5): `discovered` backups are forced to `Retain` because the operator did not create those snapshots. ``` use kopiur_api::Origin; assert_eq!(Origin::default(), Origin::Scheduled); // Serializes camelCase, matching the `origin` label/status value. assert_eq!(serde_json::to_value(Origin::Discovered).unwrap(), "discovered"); ```
enum: scheduled, manual, discovered
phase string
Lifecycle phase of a `Snapshot`. Closed enum. ADR §3.4 status. ``` use kopiur_api::{SnapshotPhase, PhaseLabel}; assert_eq!(SnapshotPhase::default(), SnapshotPhase::Pending); // `PhaseLabel::label` gives the stable string used in status/metrics. assert_eq!(SnapshotPhase::Succeeded.label(), "Succeeded"); // Every variant is enumerated for metric reset. assert_eq!(SnapshotPhase::ALL.len(), 6); ```
enum: Pending, Running, Succeeded, Failed, Deleting, Discovered
pinned boolean
The observed kopia-side pin state (ADR-0005 §13(c)): `Some(true)` once the operator has applied the pin, `Some(false)` once it has removed it, `None` before any pin reconcile. The reconciler compares `spec.pin` against this to decide whether to issue a `kopia snapshot pin`/`unpin`, so a redundant op is never spawned.
resolved object
Frozen recipe values at run time (scheduled/manual). ADR §3.4.
repository object
The repository this run targeted, frozen at run time. ADR §3.4 status.
kind string
Which repository CRD this points at; defaults to [`RepositoryKind::Repository`].
enum: Repository, ClusterRepository
name string required
Name of the referenced `Repository`/`ClusterRepository`.
namespace string
Cross-namespace `Repository` reference; ignored/forbidden for `ClusterRepository`.
sources []object
The concrete PVCs + source paths backed up this run. ADR §3.4 status.
pvc string
`namespace/name` of the PVC, as kopia sees it. ADR §3.4.
sourcePath string
The source path kopia recorded for this PVC. ADR §3.4/§4.2.
snapshot object
The kopia artifact this CR represents. ADR §3.4.
identity object required
The `username@hostname:path` identity recorded for this snapshot. ADR §3.4/§4.2.
hostname string required
The final `hostname` kopia records, fixed at admission.
sourcePath string
The resolved snapshot source path, when applicable (`username@hostname:path`).
username string required
The final `username` kopia records, fixed at admission.
kopiaSnapshotID string required
kopia's snapshot ID — the handle the finalizer uses to delete content. Renamed to match the ADR wire shape exactly (`kopiaSnapshotID`, capital `ID`); serde's `camelCase` would otherwise produce `kopiaSnapshotId`.
staged object
The CSI staging objects the run created for `copyMethod: Snapshot`/`Clone` (ADR §3.3). Pinned once when the stage is provisioned so the reconciler can (a) reuse the same VolumeSnapshot/PVC across mover-Job retries idempotently and (b) reap them on the terminal transition. Absent for `Direct` (and NFS), which mount the live source with no staging.
copyMethod string
The resolved capture method (`Snapshot` or `Clone`) that produced this stage.
pvcName string
Name of the staged `PersistentVolumeClaim` the mover mounts in place of the live source PVC.
ready boolean
`true` once the stage is ready for the mover (VolumeSnapshot `readyToUse` and the staged PVC applied). Before that the reconcile is still provisioning it.
volumeSnapshotName string
Name of the `VolumeSnapshot` created from the source PVC (`copyMethod: Snapshot` only; absent for `Clone`, which stages directly from the source PVC).
stats object
Byte/file counts parsed from kopia's JSON output. ADR §3.4 status.
bytesNew integer
Bytes newly uploaded this run (after dedup/compression). ADR §3.4 status.
format: int64
filesModified integer
Count of files changed since the previous snapshot. ADR §3.4 status.
format: int64
filesNew integer
Count of files new since the previous snapshot. ADR §3.4 status.
format: int64
filesUnchanged integer
Count of files unchanged since the previous snapshot. ADR §3.4 status.
format: int64
sizeBytes integer
Total logical size of the snapshot in bytes. ADR §3.4 status.
format: int64
timing object
Start/end/duration of the snapshot run. ADR §3.4 status.
durationSeconds integer
Wall-clock duration in seconds. ADR §3.4 status.
format: int64
endTime string
RFC3339 end time of the run. ADR §3.4 status.
startTime string
RFC3339 start time of the run. ADR §3.4 status.

No matches. Try .spec.deletionPolicy for an exact path

Copied!