From 6bf17478228c41774da3543b6cf942d713649287 Mon Sep 17 00:00:00 2001 From: Shuo Wu Date: Tue, 22 Nov 2022 21:07:09 +0800 Subject: [PATCH] chart: Add the new setting for the filesystem trim feature Longhorn 836 Signed-off-by: Shuo Wu --- chart/questions.yaml | 19 +++++++++++++++++++ chart/templates/default-setting.yaml | 1 + chart/values.yaml | 2 ++ 3 files changed, 22 insertions(+) diff --git a/chart/questions.yaml b/chart/questions.yaml index af764ab..a762a94 100644 --- a/chart/questions.yaml +++ b/chart/questions.yaml @@ -618,6 +618,15 @@ WARNING: group: "Longhorn Default Settings" type: string default: "0 0 */7 * *" +- variable: defaultSettings.removeSnapshotsDuringFilesystemTrim + label: Remove Snapshots During Filesystem Trim + description: "This setting allows Longhorn filesystem trim feature to automatically mark the latest snapshot and its ancestors as removed and stops at the snapshot containing multiple children.\n\n + Since Longhorn filesystem trim feature can be applied to the volume head and the followed continuous removed or system snapshots only.\n\n + Notice that trying to trim a removed files from a valid snapshot will do nothing but the filesystem will discard this kind of in-memory trimmable file info.\n\n + Later on if you mark the snapshot as removed and want to retry the trim, you may need to unmount and remount the filesystem so that the filesystem can recollect the trimmable file info." + group: "Longhorn Default Settings" + type: boolean + default: "false" - variable: persistence.defaultClass default: "true" description: "Set as default StorageClass for Longhorn" @@ -729,6 +738,16 @@ WARNING: group: "Longhorn Storage Class Settings" type: string default: +- variable: persistence.removeSnapshotsDuringFilesystemTrim + description: "Allow automatically removing snapshots during filesystem trim for Longhorn StorageClass" + label: Default Storage Class Remove Snapshots During Filesystem Trim + group: "Longhorn Storage Class Settings" + type: enum + options: + - "ignored" + - "enabled" + - "disabled" + default: "ignored" - variable: ingress.enabled default: "false" description: "Expose app using Layer 7 Load Balancer - ingress" diff --git a/chart/templates/default-setting.yaml b/chart/templates/default-setting.yaml index 9534991..5d59bee 100644 --- a/chart/templates/default-setting.yaml +++ b/chart/templates/default-setting.yaml @@ -73,3 +73,4 @@ data: {{ if not (kindIs "invalid" .Values.defaultSettings.snapshotDataIntegrity) }}snapshot-data-integrity: {{ .Values.defaultSettings.snapshotDataIntegrity }}{{ end }} {{ if not (kindIs "invalid" .Values.defaultSettings.snapshotDataIntegrityImmediateCheckAfterSnapshotCreation) }}snapshot-data-integrity-immediate-check-after-snapshot-creation: {{ .Values.defaultSettings.snapshotDataIntegrityImmediateCheckAfterSnapshotCreation }}{{ end }} {{ if not (kindIs "invalid" .Values.defaultSettings.snapshotDataIntegrityCronjob) }}snapshot-data-integrity-cronjob: {{ .Values.defaultSettings.snapshotDataIntegrityCronjob }}{{ end }} + {{ if not (kindIs "invalid" .Values.defaultSettings.removeSnapshotsDuringFilesystemTrim) }}remove-snapshots-during-filesystem-trim: {{ .Values.defaultSettings.removeSnapshotsDuringFilesystemTrim }}{{ end }} \ No newline at end of file diff --git a/chart/values.yaml b/chart/values.yaml index 5301502..b2f9b02 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -95,6 +95,7 @@ persistence: defaultNodeSelector: enable: false # disable by default selector: [] + removeSnapshotsDuringFilesystemTrim: ignored # "enabled" or "disabled" otherwise csi: kubeletRootDir: ~ @@ -153,6 +154,7 @@ defaultSettings: snapshotDataIntegrity: ~ snapshotDataIntegrityImmediateCheckAfterSnapshotCreation: ~ snapshotDataIntegrityCronjob: ~ + removeSnapshotsDuringFilesystemTrim: ~ privateRegistry: createSecret: ~ registryUrl: ~