Skip to content

Conversation

@diafour
Copy link
Member

@diafour diafour commented Nov 12, 2025

Description

A combination of 3 parts:

  1. feat(dvcr): add controller to cleanup registry on schedule
  • Add dvcr-maintenance controller tht triggers on schedule and secret/dvcr-maintenance changes.
    • Sets Maintenance condition on deployment/dvcr with cleanup state.
    • Creates secret to start cleanup, deletes secret when cleanup is finished.
  • Add hook to switch deployment/dvcr into maintenance mode.
  • Add spec.dvcr.gc.schedule setting to specify schedule in the ModuleConfig.
  • Cleanup is disabled by default, set schedule explicitly in spec.settings.dvcr.gc.schedule to run cleanup periodically.
  1. feat(api): postpone image operations until dvcr maintenance finishes (feat(api): postpone image operations until dvcr maintenance finishes #1689)
  • Add postpone handler that runs before all other handlers.
  • VirtualDisk: postpone only disks with dataSource that requires import to dvcr first.
  • Add ProvisioningPostponed reason for Ready condition for vi/cvi/vd resources.
  1. feat(core): add auto-cleanup and check commands in dvcr-cleaner (feat(core): add auto-cleanup and check for dvcr-cleaner #1675)

Add new commands to support auto-cleanup:

  • dvcr-cleaner gc auto-cleanup — compares images in registry and in cluster, removes manifests not found in cluster, runs garbage collect.
  • dvcr-cleaner gc check — jst compares images in registry and in cluster and prints images eligible to cleanup.

Why do we need it, and what problem does it solve?

We need to periodically cleanup non-existent images in registry to free up storage space.

What is the expected result?

dvcr storage is cleaned up on schedule.

Checklist

  • The code is covered by unit tests.
  • e2e tests passed.
  • Documentation updated according to the changes.
  • Changes were tested in the Kubernetes cluster manually.

Changelog entries

section: module
type: feature
summary: |
  Added the ability to clean up DVCR from non-existent project and cluster images:
  - By default, this feature is disabled.
  - To enable cleanup, set a schedule in the module settings: `.spec.settings.dvcr.gc.schedule`.

z9r5
z9r5 previously approved these changes Nov 13, 2025
@diafour diafour force-pushed the feat/dvcr/add-controller-to-cleanup-registry-on-schedule branch from c574929 to 899cc75 Compare November 13, 2025 10:35
@diafour diafour force-pushed the feat/dvcr/add-controller-to-cleanup-registry-on-schedule branch from 899cc75 to ed4113c Compare November 17, 2025 20:00
@diafour diafour force-pushed the feat/dvcr/add-controller-to-cleanup-registry-on-schedule branch 2 times, most recently from 2fda947 to a85fe35 Compare November 19, 2025 19:24
@diafour diafour changed the title feat(dvcr): add controller to cleanup registry on schedule feat(dvcr): auto-cleanup for dvcr storage Nov 21, 2025
@diafour diafour force-pushed the feat/dvcr/add-controller-to-cleanup-registry-on-schedule branch from b108429 to 5d8eab1 Compare November 21, 2025 10:36
@diafour diafour added the e2e/run Run e2e test on cluster of PR author label Nov 21, 2025
@deckhouse-BOaTswain
Copy link
Contributor

deckhouse-BOaTswain commented Nov 21, 2025

Workflow has started.
Follow the progress here: Workflow Run

The target step completed with status: failure.

Isteb4k
Isteb4k previously approved these changes Nov 21, 2025
@Isteb4k Isteb4k self-requested a review November 21, 2025 15:22
@deckhouse-BOaTswain deckhouse-BOaTswain removed the e2e/run Run e2e test on cluster of PR author label Nov 21, 2025
@diafour diafour force-pushed the feat/dvcr/add-controller-to-cleanup-registry-on-schedule branch from 7d6c71e to 391f8ef Compare November 21, 2025 17:07
- Add dvcr-maintenance controller tht triggers on schedule and secret/dvcr-maintenance changes.
  - Sets Maintenance condition on deployment/dvcr with cleanup state.
  - Creates secret to start cleanup, deletes secret when cleanup is finished.
- Add hook to switch deployment/dvcr into maintenance mode.
- Add gc.schedule setting to specify schedule in the ModuleConfig.

Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
…in spec.settings.dvcr.gc.schedule to run cleanup periodically.

Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
…1689)

- Cleanup is disabled by default, set schedule explicitly in spec.settings.dvcr.gc.schedule to run cleanup periodically.


* feat(api): postpone image operations until dvcr maintenance finishes

- Add postpone handler that runs before all other handlers.
- VirtualDisk: postpone only disks with dataSource that requires import to dvcr first.
- Add ProvisioningPostponed reason for Ready condition for vi/cvi/vd resources.

* feat(core): add auto-cleanup and check for dvcr-cleaner (#1675)

Add new commands to support auto-cleanup:

- dvcr-cleaner gc auto-cleanup — compares images in registry and in cluster, removes manifests not found in cluster, runs garbage collect.
- dvcr-cleaner gc check — jst compares images in registry and in cluster and prints images eligible to cleanup.


---------

Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
Signed-off-by: Ivan Mikheykin <ivan.mikheykin@flant.com>
@diafour diafour force-pushed the feat/dvcr/add-controller-to-cleanup-registry-on-schedule branch from 391f8ef to e3859c3 Compare November 21, 2025 18:04
@diafour diafour merged commit e8e70b4 into main Nov 21, 2025
27 of 28 checks passed
@diafour diafour deleted the feat/dvcr/add-controller-to-cleanup-registry-on-schedule branch November 21, 2025 18:30
This was referenced Nov 27, 2025
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.

6 participants