Skip to main content

Module snapshot_policy

Module snapshot_policy 

Source
Expand description

The SnapshotPolicy CRD — the recipe. Idempotent; runs nothing on its own. ADR-0001 §3.3, ADR-0003 §4.8.

Structs§

AdoptionSummary
Summary of the most recent automatic adoption pass for a SnapshotPolicy — discovered snapshots whose resolved identity matched this recipe and were re-attached (see Origin::Adopted), plus an on-demand re-scan request/ack pair mirroring the repository-level catalog-scan-requested-at annotation contract.
Compression
Compression policy.
DeepVerification
Deep (scratch-restore) verification: restore the latest snapshot into an ephemeral volume, then discard.
ErrorHandling
Backup-side error-handling policy: let kopia complete a snapshot with errors rather than aborting.
Files
File-ignore policy.
Hooks
Pre/post snapshot hook lists.
HttpHeader
One HTTP header sent with an httpRequest hook.
HttpRequestHook
A hook that issues an HTTP request for cross-system orchestration.
NamespaceSelector
Restricts a PvcSelector to an explicit set of namespaces.
PolicyDeletionSpec
Deletion semantics for the Snapshots carrying a SnapshotPolicy’s config label (sub-object per docs/dev/api-conventions.md §4 so future deletion knobs slot in without API breakage). Mirrors SnapshotSchedule’s ScheduleDeletionSpec.
PvcSelector
Selects PVCs across namespaces by label.
PvcSource
A single backup source addressed by PVC name.
QuickVerification
Quick (blob-level) verification tier: schedule for the frequent kopia snapshot verify.
ResolvedPolicy
The recipe as kopia would see it, pinned at admission and never re-rendered.
ResolvedPolicySource
One resolved source — a concrete PVC and the path kopia records for it.
RetentionSummary
Summary of the most recent GFS retention prune for a SnapshotPolicy.
RunJobHook
A hook that materializes a full one-shot Job (k8up PreBackupPod analog).
SnapshotPolicy
Auto-generated derived type for SnapshotPolicySpec via CustomResource
SnapshotPolicySpec
What to back up: sources, identity, retention, policy, hooks.
SnapshotPolicyStatus
Observed state of a SnapshotPolicy.
Source
A single backup source; exactly one of pvc, pvcSelector, nfs (webhook-enforced).
StagingSpec
SnapshotPolicy.spec.staging — knobs for the CSI capture (copyMethod: Snapshot/Clone) that runs before the mover. A sub-object so future staging fields slot in without API breakage.
Upload
Upload parallelism (kopia’s upload policy); absent knobs leave kopia’s default.
Verification
First-class backup verification proving snapshots are restorable; opt-in, with quick and deep tiers.
WorkloadExecHook
kubectl exec-style hook into a matched workload pod/container.

Enums§

CopyMethod
Volume snapshot copy method. Closed enum. ADR §3.3.
GroupBy
Multi-PVC grouping strategy. Defaults to a consistent group snapshot across all PVCs; set None explicitly to accept independent per-PVC snapshots, because a silent per-PVC fallback would produce inconsistent backups.
Hook
One of three hook forms. Externally-tagged: the wire shape is { workloadExec: {...} }, { runJob: {...} }, or { httpRequest: {...} }, and exactly one form is present.
SourcePathStrategy
How a selector-matched PVC’s source path is derived. Only relevant for pvcSelector sources, where one recipe expands to many PVCs and each needs a distinct kopia source path. Defaults to PvcName.

Functions§

default_ignore_rules
The default OS-artifact exclude set for Files.ignore_rules — filesystem/NAS junk that is never intentional user data, so excluding it by default is additive-safe. Per-entry rationale:
effective_on_policy_delete
The effective cascade policy for a SnapshotPolicy: spec.deletion.onPolicyDelete when the sub-object is present, else Retain. (A default nested under an ABSENT optional sub-object does not materialize server-side — every read goes through this resolver.)
source_mutates_live_volume
Whether this source’s mount lets the kubelet rewrite the live workload volume: a writable mount with no staging in front of it.
source_read_only
Whether a source is mounted read-only. THE resolver for Source::read_only’s absent case, so the CRD’s advertised default: true and the mount agree by construction rather than by coincidence.