From 3818ab7583da2e572753ed766ae990a981abecc8 Mon Sep 17 00:00:00 2001 From: Tiago Castro Date: Thu, 11 Apr 2024 10:46:49 +0100 Subject: [PATCH] refactor(rebuild): tidy up helm variables for rebuild Tidy up all rebuild related vars in rebuild and partial dicts. Signed-off-by: Tiago Castro --- chart/README.md | 4 +++- .../agents/core/agent-core-deployment.yaml | 18 +++++++-------- .../mayastor/agents/ha/ha-node-daemonset.yaml | 4 ++-- .../mayastor/csi/csi-node-daemonset.yaml | 8 +++---- chart/values.yaml | 22 ++++++++++--------- 5 files changed, 30 insertions(+), 26 deletions(-) diff --git a/chart/README.md b/chart/README.md index 85ac80249..8750a60df 100644 --- a/chart/README.md +++ b/chart/README.md @@ -70,8 +70,10 @@ This removes all the Kubernetes components associated with the chart and deletes | agents.​core.​capacity.​thin.​volumeCommitment | When creating replicas for an existing volume, each replica pool must have at least this much free space percentage of the volume size. Example: if this value is 40, the pool has 40GiB free, then the max volume size allowed to be created on the pool is 100GiB. | `"40%"` | | agents.​core.​capacity.​thin.​volumeCommitmentInitial | Same as the `volumeCommitment` argument, but applicable only when creating replicas for a new volume. | `"40%"` | | agents.​core.​logLevel | Log level for the core service | `"info"` | -| agents.​core.​partialRebuildWaitPeriod | If a faulted replica comes back online within this time period then it will be rebuilt using the partial rebuild capability (using a log of missed IO), hence a bit faster depending on the log size. Otherwise, the replica will be fully rebuilt. A blank value "" means internally derived value will be used. | `""` | | agents.​core.​priorityClassName | Set PriorityClass, overrides global. If both local and global are not set, the final deployment manifest has a mayastor custom critical priority class assigned to the pod by default. Refer the `templates/_helpers.tpl` and `templates/mayastor/agents/core/agent-core-deployment.yaml` for more details. | `""` | +| agents.​core.​rebuild.​maxConcurrent | The maximum number of system-wide rebuilds permitted at any given time. If set to an empty string, there are no limits. | `""` | +| agents.​core.​rebuild.​partial.​enabled | Partial rebuild uses a log of missed IO to rebuild replicas which have become temporarily faulted, hence a bit faster, depending on the log size. | `true` | +| agents.​core.​rebuild.​partial.​waitPeriod | If a faulted replica comes back online within this time period then it will be rebuilt using the partial rebuild capability. Otherwise, the replica will be fully rebuilt. A blank value "" means internally derived value will be used. | `""` | | agents.​core.​resources.​limits.​cpu | Cpu limits for core agents | `"1000m"` | | agents.​core.​resources.​limits.​memory | Memory limits for core agents | `"128Mi"` | | agents.​core.​resources.​requests.​cpu | Cpu requests for core agents | `"500m"` | diff --git a/chart/templates/mayastor/agents/core/agent-core-deployment.yaml b/chart/templates/mayastor/agents/core/agent-core-deployment.yaml index dfa1e2ba5..0d5b8de99 100644 --- a/chart/templates/mayastor/agents/core/agent-core-deployment.yaml +++ b/chart/templates/mayastor/agents/core/agent-core-deployment.yaml @@ -54,18 +54,18 @@ spec: - "--pool-commitment={{ .Values.agents.core.capacity.thin.poolCommitment }}" - "--snapshot-commitment={{ .Values.agents.core.capacity.thin.snapshotCommitment }}" - "--volume-commitment-initial={{ .Values.agents.core.capacity.thin.volumeCommitmentInitial }}" - - "--volume-commitment={{ .Values.agents.core.capacity.thin.volumeCommitment }}"{{ if .Values.agents.core.partialRebuildWaitPeriod }} - - "--faulted-child-wait-period={{ .Values.agents.core.partialRebuildWaitPeriod }}"{{ end }}{{ if .Values.eventing.enabled }} - - "--events-url=nats://{{ .Release.Name }}-nats:4222"{{ end }} - {{- if not .Values.agents.ha.enabled }} + - "--volume-commitment={{ .Values.agents.core.capacity.thin.volumeCommitment }}"{{ if .Values.eventing.enabled }} + - "--events-url=nats://{{ .Release.Name }}-nats:4222"{{ end }}{{ if not .Values.agents.ha.enabled }} - "--disable-ha"{{ end }} - "--fmt-style={{ include "logFormat" . }}" - "--ansi-colors={{ .Values.base.logging.color }}" - - "--create-volume-limit={{ .Values.agents.core.maxCreateVolume }}"{{ if .Values.agents.core.maxRebuilds }} - - "--max-rebuilds={{ .Values.agents.core.maxRebuilds }}"{{ end }} - {{- if .Values.agents.core.partialRebuildDisable }} - - "--disable-partial-rebuild" - {{- end }} + - "--create-volume-limit={{ .Values.agents.core.maxCreateVolume }}" + {{- if $wait := default ((.Values.agents.core.rebuild).partial).waitPeriod .Values.agents.core.partialRebuildWaitPeriod }} + - "--faulted-child-wait-period={{ $wait }}"{{ end }} + {{- if (.Values.agents.core.rebuild).maxConcurrent }} + - "--max-rebuilds={{ .Values.agents.core.rebuild.maxConcurrent }}"{{ end }} + {{- if eq ((.Values.agents.core.rebuild).partial).enabled false }} + - "--disable-partial-rebuild"{{ end }} ports: - containerPort: 50051 env: diff --git a/chart/templates/mayastor/agents/ha/ha-node-daemonset.yaml b/chart/templates/mayastor/agents/ha/ha-node-daemonset.yaml index 91fe71e63..d5d40ce23 100644 --- a/chart/templates/mayastor/agents/ha/ha-node-daemonset.yaml +++ b/chart/templates/mayastor/agents/ha/ha-node-daemonset.yaml @@ -71,7 +71,7 @@ spec: value: "1" args: - "--node-name=$(MY_NODE_NAME)" - - "--csi-socket={{ .Values.csi.node.pluginMountPath }}/{{ .Values.csi.node.socketPath }}" + - "--csi-socket={{ default .Values.csi.node.pluginMountPath .Values.csi.node.pluginMounthPath }}/{{ .Values.csi.node.socketPath }}" - "--grpc-endpoint=$(MY_POD_IP):50053" - "--cluster-agent=https://{{ .Release.Name }}-agent-core:50052"{{ if .Values.base.jaeger.enabled }} - "--jaeger={{ .Values.base.jaeger.agent.name }}:{{ .Values.base.jaeger.agent.port }}"{{ end }}{{ if .Values.eventing.enabled }} @@ -86,7 +86,7 @@ spec: - name: run-udev mountPath: /run/udev - name: plugin-dir - mountPath: {{ .Values.csi.node.pluginMountPath }} + mountPath: {{ default .Values.csi.node.pluginMountPath .Values.csi.node.pluginMounthPath }} resources: limits: cpu: {{ .Values.agents.ha.node.resources.limits.cpu | quote }} diff --git a/chart/templates/mayastor/csi/csi-node-daemonset.yaml b/chart/templates/mayastor/csi/csi-node-daemonset.yaml index 681d3b324..40054d511 100644 --- a/chart/templates/mayastor/csi/csi-node-daemonset.yaml +++ b/chart/templates/mayastor/csi/csi-node-daemonset.yaml @@ -82,7 +82,7 @@ spec: value: {{ .Values.csi.node.mkfs_args.xfs | quote }} {{- end }} args: - - "--csi-socket={{ .Values.csi.node.pluginMountPath }}/{{ .Values.csi.node.socketPath }}" + - "--csi-socket={{ default .Values.csi.node.pluginMountPath .Values.csi.node.pluginMounthPath }}/{{ .Values.csi.node.socketPath }}" - "--node-name=$(MY_NODE_NAME)" - "--rest-endpoint=http://{{ .Release.Name }}-api-rest:8081" - "--enable-registration" @@ -109,7 +109,7 @@ spec: - name: run-udev mountPath: /run/udev - name: plugin-dir - mountPath: {{ .Values.csi.node.pluginMountPath }} + mountPath: {{ default .Values.csi.node.pluginMountPath .Values.csi.node.pluginMounthPath }} - name: kubelet-dir mountPath: {{ .Values.csi.node.kubeletDir }} mountPropagation: "Bidirectional" @@ -124,11 +124,11 @@ spec: image: "{{ .Values.csi.image.registry }}/{{ .Values.csi.image.repo }}/csi-node-driver-registrar:{{ .Values.csi.image.registrarTag }}" imagePullPolicy: {{ .Values.csi.image.pullPolicy }} args: - - "--csi-address={{ .Values.csi.node.pluginMountPath }}/{{ .Values.csi.node.socketPath }}" + - "--csi-address={{ default .Values.csi.node.pluginMountPath .Values.csi.node.pluginMounthPath }}/{{ .Values.csi.node.socketPath }}" - "--kubelet-registration-path={{ .Values.csi.node.kubeletDir }}/plugins/io.openebs.mayastor/csi.sock" volumeMounts: - name: plugin-dir - mountPath: {{ .Values.csi.node.pluginMountPath }} + mountPath: {{ default .Values.csi.node.pluginMountPath .Values.csi.node.pluginMounthPath }} - name: registration-dir mountPath: /registration resources: diff --git a/chart/values.yaml b/chart/values.yaml index 36d0997d3..dd3e8dfcd 100644 --- a/chart/values.yaml +++ b/chart/values.yaml @@ -174,16 +174,18 @@ agents: # Example: if this value is 40, the pool has 40GiB free, then the max volume size allowed # to be snapped on the pool is 100GiB. snapshotCommitment: "40%" - # -- If a faulted replica comes back online within this time period then it will be - # rebuilt using the partial rebuild capability (using a log of missed IO), hence a bit - # faster depending on the log size. Otherwise, the replica will be fully rebuilt. - # A blank value "" means internally derived value will be used. - partialRebuildWaitPeriod: "" - # Set to true to disable partial rebuilds. - partialRebuildDisable: - # The maximum number of system-wide rebuilds permitted at any given time. - # If set to an empty string, there are no limits. - maxRebuilds: "" + rebuild: + # -- The maximum number of system-wide rebuilds permitted at any given time. + # If set to an empty string, there are no limits. + maxConcurrent: "" + partial: + # -- Partial rebuild uses a log of missed IO to rebuild replicas which have become temporarily faulted, + # hence a bit faster, depending on the log size. + enabled: true + # -- If a faulted replica comes back online within this time period then it will be + # rebuilt using the partial rebuild capability. Otherwise, the replica will be fully rebuilt. + # A blank value "" means internally derived value will be used. + waitPeriod: "" # The maximum number of concurrent create volume requests. maxCreateVolume: 10