feat: add custom labels to storage PVCs - #239
Merged
Merged
Conversation
Signed-off-by: nieri0x73 <122804277+nieri0x73@users.noreply.github.com>
Signed-off-by: Ricardino Guarnieri <122804277+guarnz@users.noreply.github.com> # Conflicts: # charts/vaultwarden/Chart.yaml
…abels Signed-off-by: Ricardino Guarnieri <122804277+guarnz@users.noreply.github.com> # Conflicts: # charts/vaultwarden/Chart.yaml
Owner
|
Hi @guarnz 😊, Please:
|
Signed-off-by: Ricardino Guarnieri <122804277+guarnz@users.noreply.github.com>
Contributor
Author
|
Hi @guerzon, thanks for the review! 😊 Bumped the chart version to 0.46.0. |
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.
Adds support for setting custom labels on the storage PVCs (
storage.dataandstorage.attachments), rendered on thevolumeClaimTemplatesof the StatefulSet.Why
Some controllers select PersistentVolumeClaims by label, not by annotation or pod. My use case is Longhorn's backup automation: a Longhorn
RecurringJobruns backups against the volumes that carry a specific label — there is no annotation or pod-based alternative for this. See the docs:recurring-job-group.longhorn.io/<group>.Today the chart hardcodes the PVC labels (only the
app.kubernetes.io/*set), so there is no way to add such a selector label from values. The only workarounds arestorage.existingVolumeClaim(manage the PVC yourself) or a manualkubectl label, both of which break the GitOps flow.Custom PVC labels are useful beyond this single case — e.g. selecting volumes for other backup/snapshot operators (Velero, Kanister) that also act on volumes by label.
Changes
templates/_pvcSpec.tpl: renderstorage.data.labelsandstorage.attachments.labelson the respectivevolumeClaimTemplates, merged after the existingapp.kubernetes.io/*labelsvalues.yaml: document the new optionallabelskey understorage.dataandstorage.attachmentsChart.yaml: version bump 0.43.1 → 0.44.0 (minor; new feature)storage.data/storage.attachmentsare documented as dictionaries)Notes
labelsset, the rendered output is unchanged.volumeClaimTemplatesare immutable on an existing StatefulSet, labels apply to newly provisioned PVCs (same as the existing PVC fields).Example