feat(storage): expose volume encryption for the LVM CSI StorageClass - #1121
Draft
abonillabeeche wants to merge 1 commit into
Draft
feat(storage): expose volume encryption for the LVM CSI StorageClass#1121abonillabeeche wants to merge 1 commit into
abonillabeeche wants to merge 1 commit into
Conversation
The StorageClass creation form only rendered the encryption toggle + secret picker for the Longhorn provisioner components; the LVM provisioner form had no way to enable encryption. Add the same encryption UI to the LVM provisioner so users can create encrypted lvm.driver.harvesterhci.io StorageClasses from the dashboard. The block mirrors provisioners/driver.longhorn.io_v1.vue: a Volume Encryption RadioGroup bound to parameters.encrypted, and a Secret LabeledSelect that populates the csi.storage.k8s.io provisioner/node-publish/node-stage (and node-expand, when the online-expansion feature is enabled) secret parameters from CSI_SECRETS. It is gated on the existing `volumeEncryption` feature flag (value.volumeEncryptionFeatureEnabled) and reuses the secret prefetch already done in index.vue. Encrypted params are stripped from the raw KeyValue editor to avoid duplicate entry. Everything downstream (VM images, volumes, VMs, snapshot/backup restore) already recognizes an encrypted StorageClass generically via StorageClass.isEncrypted (parameters.encrypted === 'true'), so no other UI changes are needed. Companion driver support: harvester/csi-driver-lvm#67. Signed-off-by: Alejandro Bonilla <abonilla@suse.com>
abonillabeeche
force-pushed
the
feat/lvm-encryption-storageclass
branch
from
August 19, 2026 01:45
f81ae87 to
62b6b83
Compare
This was referenced Aug 19, 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.
Problem
The StorageClass creation form renders the encryption toggle + secret picker only
for the Longhorn provisioner components (
provisioners/driver.longhorn.io_v1.vue/_v2.vue). The LVM provisioner form (provisioners/lvm.driver.harvesterhci.io.vue) hasno way to enable encryption, so users cannot create an encrypted
lvm.driver.harvesterhci.ioStorageClass from the dashboard — they'd have to hand-editYAML.
Change
Add the same encryption UI to the LVM provisioner component:
RadioGroupbound toparameters.encrypted.LabeledSelectthat populates thecsi.storage.k8s.io/*provisioner /node-publish / node-stage (and node-expand, when the online-expansion feature is on)
secret parameters from the shared
CSI_SECRETSmap — identical to Longhorn.volumeEncryptionfeature flag(
value.volumeEncryptionFeatureEnabled); reuses theSECRETprefetch already done inindex.vue.KeyValueeditor to avoiddouble entry.
Nothing else needs to change: images, volumes, VMs and snapshot/backup restore already
detect encryption generically via
StorageClass.isEncrypted(
parameters.encrypted === 'true'), which is provisioner-agnostic. The CDI Settingstab already lets users set
cloneStrategy: copy, which encrypted LVM SCs need so CDIimage clones write through the dm-crypt mapper.
Why the same secret schema works
The LVM CSI driver uses the same
encrypted: "true"+CRYPTO_KEY_*secret conventionas Longhorn (validated end-to-end: LUKS2/aes-xts-plain64 on disk, Linux + Windows VMs,
snapshots, Kasten backup/restore all confirmed encrypted). Driver-side support:
harvester/csi-driver-lvm#67.
Test plan
yarn lint+ build in CI.volumeEncryptionfeature enabled, create a StorageClass, select theLVM provisioner, toggle Volume Encryption on, pick a
CRYPTO_KEY_*secret, save, andconfirm the resulting SC has
encrypted: "true"+ the CSI secret params.Related