Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions charts/snapshot/templates/_helpers.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,11 @@ reads for rootfs-diff capture, and CRI-O config.json fallback).

{{/* Remote agents must never run without the corresponding admission guard. */}}
{{- define "snapshot.provenanceChecks" -}}
{{- if and .Values.operator.enabled (not .Values.operator.mountArtifactPVC) -}}
{{- if or (not .Values.provenance.consumer.enabled) .Values.daemonset.enabled -}}
{{- fail "operator.mountArtifactPVC=false requires a provenance consumer without a local agent" -}}
{{- end -}}
{{- end -}}
{{- if .Values.provenance.consumer.enabled -}}
{{- if not .Values.operator.enabled -}}{{- fail "provenance.consumer requires operator.enabled=true" -}}{{- end -}}
{{- $_ := required "provenance.consumer.namespace is required" .Values.provenance.consumer.namespace -}}
Expand Down
7 changes: 7 additions & 0 deletions charts/snapshot/templates/operator-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,15 @@ spec:
readOnly: true
volumes:
- name: checkpoints
{{- if .Values.operator.mountArtifactPVC }}
persistentVolumeClaim:
claimName: {{ .Values.storage.pvc.name }}
{{- else }}
# Remote agents own every artifact. Local maintenance sees an empty
# directory; the workload claim may be pinned to a virtual node.
emptyDir:
sizeLimit: 16Mi
{{- end }}
- name: storage-config
configMap:
name: {{ include "snapshot.fullname" . }}-config
Expand Down
37 changes: 37 additions & 0 deletions charts/snapshot/tests/artifact_cleanup_test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,43 @@ suite: PodSnapshotContent artifact cleanup
templates:
- templates/operator-deployment.yaml
tests:
- it: keeps a remote-only consumer independent of workload PVC scheduling
set:
daemonset.enabled: false
operator.mountArtifactPVC: false
operator.artifactCleanup.remoteAgentNodes: [virtual-a]
provenance.consumer:
enabled: true
namespace: source
asserts:
- equal:
path: spec.template.spec.volumes[0].emptyDir.sizeLimit
value: 16Mi
- notExists:
path: spec.template.spec.volumes[0].persistentVolumeClaim
- contains:
path: spec.template.spec.containers[0].args
content: --artifact-cleanup-remote-agent-nodes=virtual-a
- it: refuses to remove artifact access from an operator with a local agent
set:
operator.mountArtifactPVC: false
operator.artifactCleanup.remoteAgentNodes: [virtual-a]
provenance.consumer:
enabled: true
namespace: source
asserts:
- failedTemplate:
errorPattern: operator.mountArtifactPVC=false requires a provenance consumer without a local agent
- it: refuses to remove artifact access without remote cleanup delegation
set:
daemonset.enabled: false
operator.mountArtifactPVC: false
provenance.consumer:
enabled: true
namespace: source
asserts:
- failedTemplate:
errorPattern: provenance.consumer requires artifactCleanup.remoteAgentNodes
- it: mounts shared artifact storage and wires cleanup defaults
asserts:
- equal:
Expand Down
4 changes: 4 additions & 0 deletions charts/snapshot/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ replicaCount: 1

operator:
enabled: true
# Remote-only consumers delegate artifact access to provider agents. They
# use an empty scratch directory instead of mounting the provider's PVC.
# Disabling this requires consumer provenance and a disabled local agent.
mountArtifactPVC: true
resources:
limits:
cpu: 500m
Expand Down
12 changes: 12 additions & 0 deletions docs/operations/liqo-control-plane.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,18 @@ acknowledgements are written to the consumer; Pod conditions and finalizers are
written to the provider. Liqo carries the Pod status back to the consumer.
Snapshot objects and their UIDs are never copied to another API server.

For a consumer with no local agents, set `operator.mountArtifactPVC: false`
alongside `daemonset.enabled: false`, consumer provenance and the delegated
`operator.artifactCleanup.remoteAgentNodes`. The operator uses an empty scratch
directory for local maintenance instead of mounting the workload artifact
claim. This lets it stay on a control-plane node when that claim is bound to a
provider virtual node. Provider agents still mount the real artifact PVC;
the consumer's workload Pods still reference their scheduling claim.
Mixed local/remote installations and clusters with existing native content must
keep the operator's PVC mount enabled. Inventory existing content before
disabling the mount; local maintenance cannot inspect another store through
the scratch directory.

## Required binding

An agent binds exactly one consumer namespace, accepted Liqo NamespaceMap
Expand Down
Loading