feat(operator)!: replace per-purpose PVCs with a single unified /klio PVC - #245
Merged
Conversation
armru
approved these changes
Sep 9, 2026
gabriele-wolfox
force-pushed
the
single-pvc
branch
4 times, most recently
from
September 10, 2026 09:02
2d853d8 to
3194998
Compare
… PVC The Server used to provision four PVCs, each gated on the tier that needed it: data and cachetier1 for tier1, cachetier2 for tier2, and queue for the work queue. Sizing four volumes independently is awkward to operate and leaves capacity stranded in whichever one was under-provisioned. Every server now gets exactly one PVC, named klio and mounted at /klio, holding the same state as fixed subdirectories: /klio/data, /klio/queue, /klio/cache_tier1 and /klio/cache_tier2. Read-only tier2-only servers get the PVC and the mount too; the core creates only the subdirectories the active tiers need, via afero so tests can exercise directory creation against an in-memory filesystem instead of real disk. Directory creation (WAL, Kopia repository, cache, queue) now happens in one place, initializeTier1, before the server starts. spec.storage.pvcTemplate replaces spec.tier1.data, spec.tier1.cache, spec.tier2.cache and spec.queue, and the four per-PVC shrink guards collapse into one CEL rule on ServerSpec. That rule is guarded against Servers created before spec.storage existed: evaluating it against a pre-migration Server used to crash admission with a CEL "no such key" error instead of failing cleanly. PVC resize now targets that single PVC directly by its deterministic name instead of listing and filtering by label, and the klio.cnpg.io/type label, which never gained a second value, is dropped from the StatefulSet/Service/Pods. BREAKING CHANGE: Server.spec.tier1.data, Server.spec.tier1.cache, Server.spec.tier2.cache and Server.spec.queue are removed and replaced by the required Server.spec.storage. Existing Server resources are invalid against the new CRD and must be rewritten. The old PVCs are retained but no longer used; migrating their contents into the unified volume is a manual procedure, documented in the "0.0.20 to 0.0.21" section of upgrade_notes.md. Closes #135, closes #136 Assisted-by: Claude Signed-off-by: Francesco Canovai <francesco.canovai@enterprisedb.com>
The initializeTier1 check already rejects a tier1 server without a queue before runServer is reached, so the second check was unreachable. Also note in the directory tests that they rely on the kopia binary being absent. Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
With a single PVC the label can only ever hold the value klio and nothing in the operator reads it any more: resize looks the PVC up by its deterministic name. Key the e2e size checks by PVC name as well. Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
Name the operator log line that is the only signal while a Server is waiting to be migrated, state the PVC name as hardcoded by the operator and give the kubectl check to run after migration. Drop the pvcType label from the sample manifest. Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
The spellcheck CI flags "hardcodes" as unknown in upgrade_notes.md. Signed-off-by: Armando Ruocco <armando.ruocco@enterprisedb.com>
The function initializeTier1 already errors when the queue directory is unset, but no test exercised that path, leaving it without regression coverage. Co-Authored-By: Claude Signed-off-by: Gabriele Quaresima <gabriele.quaresima@enterprisedb.com>
The storage-shrink CEL rule was updated to short-circuit when oldSelf.storage is missing, fixing an admission crash for Servers stored before spec.storage existed. No test created such a Server, so the fix had no regression coverage. Co-Authored-By: Claude Signed-off-by: Gabriele Quaresima <gabriele.quaresima@enterprisedb.com>
gabriele-wolfox
force-pushed
the
single-pvc
branch
from
September 10, 2026 09:20
3194998 to
07c50f6
Compare
gabriele-wolfox
approved these changes
Sep 10, 2026
This was referenced Sep 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The Server used to provision four PVCs, each gated on the tier that needed it: data and cachetier1 for tier1, cachetier2 for tier2, and queue for the work queue. Sizing four volumes independently is awkward to operate and leaves capacity stranded in whichever one was under-provisioned.
Every server now gets exactly one PVC, named klio and mounted at /klio, holding the same state as fixed subdirectories: /klio/data, /klio/queue, /klio/cache_tier1 and /klio/cache_tier2. Read-only tier2-only servers get the PVC and the mount too; the core creates only the subdirectories the active tiers need, via afero so tests can exercise directory creation against an in-memory filesystem instead of real disk. Directory creation (WAL, Kopia repository, cache, queue) now happens in one place, initializeTier1, before the server starts.
spec.storage.pvcTemplate replaces spec.tier1.data, spec.tier1.cache, spec.tier2.cache and spec.queue, and the four per-PVC shrink guards collapse into one CEL rule on ServerSpec. That rule is guarded against Servers created before spec.storage existed: evaluating it against a pre-migration Server used to crash admission with a CEL "no such key" error instead of failing cleanly. PVC resize now targets that single PVC directly by its deterministic name instead of listing and filtering by label, and the klio.cnpg.io/type label, which never gained a second value, is dropped from the StatefulSet/Service/Pods.
BREAKING CHANGE: Server.spec.tier1.data, Server.spec.tier1.cache, Server.spec.tier2.cache and Server.spec.queue are removed and replaced by the required Server.spec.storage. Existing Server resources are invalid against the new CRD and must be rewritten. The old PVCs are retained but no longer used; migrating their contents into the unified volume is a manual procedure, documented in the "0.0.20 to 0.0.21" section of upgrade_notes.md.
Closes #135, closes #136
Assisted-by: Claude