From dd3f5584f6f772f1810edfc28b788151290126e0 Mon Sep 17 00:00:00 2001 From: Eric Weber Date: Thu, 27 Jul 2023 16:39:34 -0500 Subject: [PATCH] Add ReplicaDiskSoftAntiAffinity setting Signed-off-by: Eric Weber --- chart/questions.yaml | 6 ++++++ chart/templates/crds.yaml | 11 +++++++++-- chart/templates/default-setting.yaml | 1 + chart/values.yaml | 1 + deploy/longhorn.yaml | 11 +++++++++-- 5 files changed, 26 insertions(+), 4 deletions(-) diff --git a/chart/questions.yaml b/chart/questions.yaml index 287a153..f6aaf40 100644 --- a/chart/questions.yaml +++ b/chart/questions.yaml @@ -432,6 +432,12 @@ If disabled, Longhorn will not delete the workload pod that is managed by a cont group: "Longhorn Default Settings" type: boolean default: "true" + - variable: defaultSettings.replicaDiskSoftAntiAffinity + label: Replica Disk Level Soft Anti-Affinity + description: 'Allow scheduling on disks with existing healthy replicas of the same volume. By default true.' + group: "Longhorn Default Settings" + type: boolean + default: "true" - variable: defaultSettings.allowEmptyNodeSelectorVolume label: Allow Empty Node Selector Volume description: "Allow Scheduling Empty Node Selector Volumes To Any Node" diff --git a/chart/templates/crds.yaml b/chart/templates/crds.yaml index ac56efe..dfc7cd8 100644 --- a/chart/templates/crds.yaml +++ b/chart/templates/crds.yaml @@ -3380,15 +3380,22 @@ spec: - least-effort - best-effort type: string + replicaDiskSoftAntiAffinity: + description: Replica disk soft anti affinity of the volume. Set enabled to allow replicas to be scheduled in the same disk. + enum: + - ignored + - enabled + - disabled + type: string replicaSoftAntiAffinity: - description: Replica soft anti affinity of the volume. Set enabled to allow replicas to be scheduled on the same node + description: Replica soft anti affinity of the volume. Set enabled to allow replicas to be scheduled on the same node. enum: - ignored - enabled - disabled type: string replicaZoneSoftAntiAffinity: - description: Replica zone soft anti affinity of the volume. Set enabled to allow replicas to be scheduled in the same zone + description: Replica zone soft anti affinity of the volume. Set enabled to allow replicas to be scheduled in the same zone. enum: - ignored - enabled diff --git a/chart/templates/default-setting.yaml b/chart/templates/default-setting.yaml index 59a1c19..5004f5d 100644 --- a/chart/templates/default-setting.yaml +++ b/chart/templates/default-setting.yaml @@ -51,6 +51,7 @@ data: {{ if not (kindIs "invalid" .Values.defaultSettings.autoDeletePodWhenVolumeDetachedUnexpectedly) }}auto-delete-pod-when-volume-detached-unexpectedly: {{ .Values.defaultSettings.autoDeletePodWhenVolumeDetachedUnexpectedly }}{{ end }} {{ if not (kindIs "invalid" .Values.defaultSettings.disableSchedulingOnCordonedNode) }}disable-scheduling-on-cordoned-node: {{ .Values.defaultSettings.disableSchedulingOnCordonedNode }}{{ end }} {{ if not (kindIs "invalid" .Values.defaultSettings.replicaZoneSoftAntiAffinity) }}replica-zone-soft-anti-affinity: {{ .Values.defaultSettings.replicaZoneSoftAntiAffinity }}{{ end }} + {{ if not (kindIs "invalid" .Values.defaultSettings.replicaDiskSoftAntiAffinity) }}replica-disk-soft-anti-affinity: {{ .Values.defaultSettings.replicaDiskSoftAntiAffinity }}{{ end }} {{ if not (kindIs "invalid" .Values.defaultSettings.nodeDownPodDeletionPolicy) }}node-down-pod-deletion-policy: {{ .Values.defaultSettings.nodeDownPodDeletionPolicy }}{{ end }} {{ if not (kindIs "invalid" .Values.defaultSettings.nodeDrainPolicy) }}node-drain-policy: {{ .Values.defaultSettings.nodeDrainPolicy }}{{ end }} {{ if not (kindIs "invalid" .Values.defaultSettings.replicaReplenishmentWaitInterval) }}replica-replenishment-wait-interval: {{ .Values.defaultSettings.replicaReplenishmentWaitInterval }}{{ end }} diff --git a/chart/values.yaml b/chart/values.yaml index e6474f4..1c63c04 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -141,6 +141,7 @@ defaultSettings: autoDeletePodWhenVolumeDetachedUnexpectedly: ~ disableSchedulingOnCordonedNode: ~ replicaZoneSoftAntiAffinity: ~ + replicaDiskSoftAntiAffinity: ~ nodeDownPodDeletionPolicy: ~ nodeDrainPolicy: ~ replicaReplenishmentWaitInterval: ~ diff --git a/deploy/longhorn.yaml b/deploy/longhorn.yaml index eb6c1ca..67cc10f 100644 --- a/deploy/longhorn.yaml +++ b/deploy/longhorn.yaml @@ -3539,15 +3539,22 @@ spec: - least-effort - best-effort type: string + replicaDiskSoftAntiAffinity: + description: Replica disk soft anti affinity of the volume. Set enabled to allow replicas to be scheduled in the same disk. + enum: + - ignored + - enabled + - disabled + type: string replicaSoftAntiAffinity: - description: Replica soft anti affinity of the volume. Set enabled to allow replicas to be scheduled on the same node + description: Replica soft anti affinity of the volume. Set enabled to allow replicas to be scheduled on the same node. enum: - ignored - enabled - disabled type: string replicaZoneSoftAntiAffinity: - description: Replica zone soft anti affinity of the volume. Set enabled to allow replicas to be scheduled in the same zone + description: Replica zone soft anti affinity of the volume. Set enabled to allow replicas to be scheduled in the same zone. enum: - ignored - enabled