Skip to content

feat(storage): expose volume encryption for the LVM CSI StorageClass - #1121

Draft
abonillabeeche wants to merge 1 commit into
harvester:mainfrom
abonillabeeche:feat/lvm-encryption-storageclass
Draft

feat(storage): expose volume encryption for the LVM CSI StorageClass#1121
abonillabeeche wants to merge 1 commit into
harvester:mainfrom
abonillabeeche:feat/lvm-encryption-storageclass

Conversation

@abonillabeeche

@abonillabeeche abonillabeeche commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Draft — I mirrored the proven driver.longhorn.io_v1.vue encryption block and
ran a JS-parse sanity check, but I could not run the extension's full yarn lint /
build locally. Please let CI (or a maintainer) verify lint/build before merge.

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) has
no way to enable encryption, so users cannot create an encrypted
lvm.driver.harvesterhci.io StorageClass from the dashboard — they'd have to hand-edit
YAML.

Change

Add the same encryption UI to the LVM provisioner component:

  • Volume Encryption RadioGroup bound to parameters.encrypted.
  • Secret LabeledSelect that populates the csi.storage.k8s.io/* provisioner /
    node-publish / node-stage (and node-expand, when the online-expansion feature is on)
    secret parameters from the shared CSI_SECRETS map — identical to Longhorn.
  • Gated on the existing volumeEncryption feature flag
    (value.volumeEncryptionFeatureEnabled); reuses the SECRET prefetch already done in
    index.vue.
  • Encryption-managed params are stripped from the raw KeyValue editor to avoid
    double 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 Settings
tab already lets users set cloneStrategy: copy, which encrypted LVM SCs need so CDI
image 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 convention
as 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

  • JS block parses (sanity-checked).
  • Needs: yarn lint + build in CI.
  • Manual: with the volumeEncryption feature enabled, create a StorageClass, select the
    LVM provisioner, toggle Volume Encryption on, pick a CRYPTO_KEY_* secret, save, and
    confirm the resulting SC has encrypted: "true" + the CSI secret params.

Related

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>
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