Skip to content

feat: Enable single stack deployments in Helm chart#828

Open
jochenseeber wants to merge 1 commit into
openebs:developfrom
CaperWhite:develop
Open

feat: Enable single stack deployments in Helm chart#828
jochenseeber wants to merge 1 commit into
openebs:developfrom
CaperWhite:develop

Conversation

@jochenseeber
Copy link
Copy Markdown
Contributor

@jochenseeber jochenseeber commented Mar 31, 2026

Description

Add a global ipFamily setting to the Helm chart that controls IP family
configuration for all chart-managed Kubernetes Services and adjusts container
bind addresses accordingly.

The setting accepts three values:

  • ipv4 -- IPv4 SingleStack, services bind to 0.0.0.0
  • ipv6 -- IPv6 SingleStack, services bind to ::
  • both (default) -- PreferDualStack with IPv4 and IPv6, services bind to ::

Two new helper templates are added to _helpers.tpl:

  • service_ip_family -- generates ipFamilyPolicy and ipFamilies fields
    for Service specs
  • bind_address -- returns the appropriate bind address (0.0.0.0 or ::)

All four chart-managed Services now include the service_ip_family helper,
and four hardcoded [::] bind addresses in container args are replaced with
the bind_address helper.

Invalid values (including empty string) are rejected at template time with an error message.

Motivation and Context

The chart previously hardcoded [::] as the bind address and did not set
ipFamilyPolicy or ipFamilies on any Service. This made deployments on
IPv4-only fail, with no way to correctly configure the components.

Regression

No

How Has This Been Tested?

Verified with helm template for all supported values:

  • Default (both): All 4 Services render with ipFamilyPolicy: PreferDualStack and ipFamilies: [IPv4, IPv6]. Bind addresses render as
    [::].
  • ipv4: All 4 Services render with ipFamilyPolicy: SingleStack and
    ipFamilies: [IPv4]. Bind addresses render as [0.0.0.0].
  • ipv6: All 4 Services render with ipFamilyPolicy: SingleStack and
    ipFamilies: [IPv6]. Bind addresses render as [::].
  • Invalid value: helm template --set ipFamily=invalid fails with error
    invalid ipFamily value "invalid" -- valid values: ipv4, ipv6, both.
  • Empty string: helm template --set ipFamily="" fails with the same
    validation error.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project (afaik :).
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added unit tests to cover my changes.

@jochenseeber jochenseeber requested a review from a team as a code owner March 31, 2026 10:59
@jochenseeber jochenseeber force-pushed the develop branch 2 times, most recently from 58f43c6 to c91ec10 Compare March 31, 2026 15:07
Comment thread chart/templates/mayastor/agents/core/agent-core-deployment.yaml Outdated
@jochenseeber jochenseeber force-pushed the develop branch 2 times, most recently from f9e187d to ac13637 Compare April 15, 2026 08:58
@tiagolobocastro
Copy link
Copy Markdown
Member

@mergify rebase

@mergify
Copy link
Copy Markdown

mergify Bot commented Apr 20, 2026

rebase

❌ Pull request can't be updated with latest base branch changes

Details

Mergify needs the author permission to update the base branch of the pull request.
@jochenseeber needs to authorize modification on its head branch.

@tiagolobocastro
Copy link
Copy Markdown
Member

@jochenseeber sorry about the delay, could you please rebase?

Signed-off-by: Jochen Seeber <jochen@seeber.me>
@github-merge-queue github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Apr 22, 2026
@tiagolobocastro
Copy link
Copy Markdown
Member

@jochenseeber , could you please take a look at the failure:


Run nix-shell ./scripts/helm/shell.nix --run "./scripts/helm/install.sh --pull-policy IfNotPresent --wait"
Installing Mayastor Chart
+ helm install mayastor ./scripts/helm/../../chart -n mayastor --create-namespace --set=etcd.livenessProbe.initialDelaySeconds=5,etcd.readinessProbe.initialDelaySeconds=5,etcd.replicaCount=1 --set=obs.callhome.enabled=true,obs.callhome.sendReport=false,localpv-provisioner.analytics.enabled=false --set=eventing.enabled=true,nats.cluster.enabled=false,nats.cluster.replicas=1 --set=loki.loki.commonConfig.replication_factor=1 --set=loki.singleBinary.replicas=1 --set=loki.minio.mode=standalone --set=loki.minio.enabled=true,loki.minio.replicas=1 --wait --timeout 5m --set image.pullPolicy=IfNotPresent
Error: INSTALLATION FAILED: 4 errors occurred:
	* Service "mayastor-obs-callhome-stats" is invalid: spec.ipFamilies[1]: Invalid value: "IPv6": not configured on this cluster
	* Service "mayastor-api-rest" is invalid: spec.ipFamilies[1]: Invalid value: "IPv6": not configured on this cluster
	* Service "mayastor-metrics-exporter-io-engine" is invalid: spec.ipFamilies[1]: Invalid value: "IPv6": not configured on this cluster
	* Service "mayastor-agent-core" is invalid: spec.ipFamilies[1]: Invalid value: "IPv6": not configured on this cluster

Copy link
Copy Markdown
Member

@niladrih niladrih left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Few minor comments. Looks good overall.

Valid values: "ipv4", "ipv6", "both"
*/}}
{{- define "service_ip_family" -}}
{{- if eq .Values.ipFamily "ipv4" }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we do the comparison after a run through tostring, lower and trim?

ipFamilyPolicy: SingleStack
ipFamilies:
- IPv4
{{- else if eq .Values.ipFamily "ipv6" }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same. Maybe use tostring, lower and trim?

ipFamilyPolicy: SingleStack
ipFamilies:
- IPv6
{{- else if eq .Values.ipFamily "both" }}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe tostring, lower and trim here as well.

Comment thread chart/README.md
| io_engine.&ZeroWidthSpace;target.&ZeroWidthSpace;nvmf.&ZeroWidthSpace;ptpl | Reservations Persist Through Power Loss State | `true` |
| io_engine.&ZeroWidthSpace;target.&ZeroWidthSpace;nvmf.&ZeroWidthSpace;rdma | Enable RDMA Capability of Mayastor nvmf target to take RDMA connections if the cluster nodes have RDMA device(s) configured from RNIC. | <pre>{<br>"enabled":false<br>}</pre> |
| io_engine.&ZeroWidthSpace;tolerations | Set tolerations, overrides global | `[]` |
| ipFamily | IP family for services and bind addresses. Valid values: "ipv4", "ipv6", "both" (default). | `"both"` |
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: the (default) is redundant as the default value is mentioned in the very next column.

Suggested change
| ipFamily | IP family for services and bind addresses. Valid values: "ipv4", "ipv6", "both" (default). | `"both"` |
| ipFamily | IP family for services and bind addresses. Valid values: "ipv4", "ipv6", "both". | `"both"` |

@tiagolobocastro
Copy link
Copy Markdown
Member

@jochenseeber , could you please take a look at the failure:


Run nix-shell ./scripts/helm/shell.nix --run "./scripts/helm/install.sh --pull-policy IfNotPresent --wait"
Installing Mayastor Chart
+ helm install mayastor ./scripts/helm/../../chart -n mayastor --create-namespace --set=etcd.livenessProbe.initialDelaySeconds=5,etcd.readinessProbe.initialDelaySeconds=5,etcd.replicaCount=1 --set=obs.callhome.enabled=true,obs.callhome.sendReport=false,localpv-provisioner.analytics.enabled=false --set=eventing.enabled=true,nats.cluster.enabled=false,nats.cluster.replicas=1 --set=loki.loki.commonConfig.replication_factor=1 --set=loki.singleBinary.replicas=1 --set=loki.minio.mode=standalone --set=loki.minio.enabled=true,loki.minio.replicas=1 --wait --timeout 5m --set image.pullPolicy=IfNotPresent
Error: INSTALLATION FAILED: 4 errors occurred:
	* Service "mayastor-obs-callhome-stats" is invalid: spec.ipFamilies[1]: Invalid value: "IPv6": not configured on this cluster
	* Service "mayastor-api-rest" is invalid: spec.ipFamilies[1]: Invalid value: "IPv6": not configured on this cluster
	* Service "mayastor-metrics-exporter-io-engine" is invalid: spec.ipFamilies[1]: Invalid value: "IPv6": not configured on this cluster
	* Service "mayastor-agent-core" is invalid: spec.ipFamilies[1]: Invalid value: "IPv6": not configured on this cluster

a gentle ping @jochenseeber

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants