Skip to content

kubevirt: chart RBAC and catalog parameters for CBT backups - #367

Open
anisurrahman75 wants to merge 7 commits into
masterfrom
kubevirt-cbt
Open

anisurrahman75 wants to merge 7 commits into
masterfrom
kubevirt-cbt

Conversation

@anisurrahman75

Copy link
Copy Markdown
Contributor

Two changes for the KubeVirt changed-block-tracking backup path:

  • Operator ClusterRole gains the backup.kubevirt.io superset rule, so the operator can grant KubeVirt addon backup jobs the permissions they need. An operator can only delegate permissions it holds, so this must mirror kubestash/kubestash#388.
  • Catalog exposes backupMode, forceFull and cbtScratchStorageClass on the kubevirt addon's logical-backup and volume-backup tasks, with the matching Function args.

Without the catalog change the Addon is Helm-managed and a BackupConfiguration selecting CBT is rejected with Param backupMode is invalid. Not defined in Task logical-backup of Addon kubevirt.

Part of the KubeVirt CBT incremental-backup work:

  • kubestash/kubevirt#kubevirt-cbt — the plugin
  • kubestash/kubestash#388 — operator RBAC

RBAC forbids granting permissions the granter does not hold, so this must stay a
superset of the KubeVirt rules in the operator's pkg/rbac job roles -- which now
include backup.kubevirt.io for changed block tracking.

Signed-off-by: Anisur Rahman <anisur@appscode.com>
Exposes backupMode, forceFull and cbtScratchStorageClass on the kubevirt
addon's backup tasks so a BackupConfiguration can select the changed-block
tracking path without a hand-edited Addon.

Signed-off-by: Anisur Rahman <anisur@appscode.com>
The appended args and parameters were indented one level short, so the raw
YAML no longer parsed. hack/fmt/main.go wipes charts/kubestash-catalog/templates
and rebuilds it from catalog/raw, silently skipping files it cannot parse, so
the three kubevirt templates were deleted rather than regenerated and the
hand-edited copies masked the broken source. Fixed at the source and let the
generator emit the templates.

Signed-off-by: Anisur Rahman <anisur@appscode.com>
A task declares one static driver, and that is what the retention policy job
keys its cleaner containers off. The existing volume-backup writes restic, so
changed-block-tracking needs its own task to get its blocks reclaimed.

Signed-off-by: Anisur Rahman <anisur@appscode.com>
The charts ship their own copies of the apimachinery CRDs, so a helm upgrade
re-applied the stale schema and rejected the new driver. These revert to
generated output once apimachinery#258 releases and the dependency is bumped.

Signed-off-by: Anisur Rahman <anisur@appscode.com>
The charts carry hand-copied CRDs that lag the apimachinery release, so the new
kind has to be copied in the same way the BlockCAS schema was: straight from
apimachinery/crds, minus the generated creationTimestamp the other copies also
drop. Both the operator chart and the certified-crds chart get it, because the
certified chart regenerates from the released operator .tgz and would otherwise
stay a kind behind until the next release.

The operator's own ClusterRole needs no new rules. Its core.kubestash.com and
storage.kubestash.com wildcards already cover kubevirtarchivers, the
BackupConfigurations and the Snapshots the reconciler owns, batch/jobs covers
the resident archiver Job, and the KubeVirt read rules added for the addon are
exactly what the controller needs to resolve and watch VirtualMachines. What
changed is why those read verbs exist: they used to be there only so the
operator could grant them onward to backup Jobs, and the comment said so.

Signed-off-by: Anisur Rahman <anisur@appscode.com>
The Snapshot CRD lagged apimachinery: BlockCASStats grew the fields the
resident archiver reports through — the checkpoint index key, first/last
checkpoint times, total and failed counts, the last failure, and the bounded
recentCheckpoints window — and RestoreSession grew dataSource.pointInTime.
Without them the operator's status writes are silently pruned by the API
server and the archiver looks idle while it is working.

Also drop creationTimestamp: null from the three CRDs that carried it. It is
generator noise, the other fourteen in the chart do not have it, and it came
back each time these files were copied across from apimachinery.

Signed-off-by: Anisur Rahman <anisur@appscode.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant