Skip to content

Commit 58f43c6

Browse files
committed
feat: Enable single stack deployments in Helm chart
1 parent 294947f commit 58f43c6

10 files changed

Lines changed: 47 additions & 4 deletions

chart/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,6 +206,7 @@ This removes all the Kubernetes components associated with the chart and deletes
206206
| io_engine.​target.​nvmf.​ptpl | Reservations Persist Through Power Loss State | `true` |
207207
| 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> |
208208
| io_engine.&ZeroWidthSpace;tolerations | Set tolerations, overrides global | `[]` |
209+
| ipFamily | IP family for services and bind addresses. Valid values: "ipv4", "ipv6", "both" (default). | `"both"` |
209210
| localpv-provisioner.&ZeroWidthSpace;enabled | Enables the openebs dynamic-localpv-provisioner. If disabled, modify etcd and loki storage class accordingly. | `true` |
210211
| localpv-provisioner.&ZeroWidthSpace;hostpathClass.&ZeroWidthSpace;enabled | Enable default hostpath localpv StorageClass. | `false` |
211212
| localpv-provisioner.&ZeroWidthSpace;localpv.&ZeroWidthSpace;priorityClassName | Set the PriorityClass for the LocalPV Hostpath provisioner Deployment. | `"{{ .Release.Name }}-cluster-critical"` |

chart/templates/_helpers.tpl

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -387,3 +387,38 @@ Usage:
387387
{{- end -}}
388388
{{- end -}}
389389
{{- end }}
390+
391+
{{/*
392+
Generates ipFamilyPolicy and ipFamilies for Service specs based on the global ipFamily setting.
393+
Valid values: "ipv4", "ipv6", "both"
394+
*/}}
395+
{{- define "service_ip_family" -}}
396+
{{- if eq .Values.ipFamily "ipv4" }}
397+
ipFamilyPolicy: SingleStack
398+
ipFamilies:
399+
- IPv4
400+
{{- else if eq .Values.ipFamily "ipv6" }}
401+
ipFamilyPolicy: SingleStack
402+
ipFamilies:
403+
- IPv6
404+
{{- else if eq .Values.ipFamily "both" }}
405+
ipFamilyPolicy: PreferDualStack
406+
ipFamilies:
407+
- IPv4
408+
- IPv6
409+
{{- else }}
410+
{{- fail (printf "invalid ipFamily value %q -- valid values: ipv4, ipv6, both" .Values.ipFamily) -}}
411+
{{- end -}}
412+
{{- end -}}
413+
414+
{{/*
415+
Returns the bind address based on ipFamily.
416+
ipv4 → "0.0.0.0", ipv6 or both → "::"
417+
*/}}
418+
{{- define "bind_address" -}}
419+
{{- if eq .Values.ipFamily "ipv4" -}}
420+
0.0.0.0
421+
{{- else -}}
422+
::
423+
{{- end -}}
424+
{{- end -}}

chart/templates/mayastor/agents/core/agent-core-deployment.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ spec:
5353
{{- end }}
5454
- "--cache-period={{ .Values.base.cache_poll_period }}"{{ if .Values.base.jaeger.enabled }}
5555
- "--jaeger={{ include "jaeger_url" . }}"{{ end }}
56-
- "--grpc-server-addr=[::]:50051"
56+
- "--grpc-server-addr=[{{ include "bind_address" . }}]:50051"
5757
- "--pool-commitment={{ .Values.agents.core.capacity.thin.poolCommitment }}"
5858
- "--snapshot-commitment={{ .Values.agents.core.capacity.thin.snapshotCommitment }}"
5959
- "--volume-commitment-initial={{ .Values.agents.core.capacity.thin.volumeCommitmentInitial }}"
@@ -107,7 +107,7 @@ spec:
107107
image: "{{ .Values.image.registry }}/{{ .Values.image.repo }}/{{ include "image_prefix" . }}-agent-ha-cluster:{{ default .Values.image.tag .Values.image.repoTags.controlPlane }}"
108108
imagePullPolicy: {{ .Values.image.pullPolicy }}
109109
args:
110-
- "-g=[::]:50052"
110+
- "-g=[{{ include "bind_address" . }}]:50052"
111111
- "--store=http://{{ include "etcdUrl" . }}"
112112
- "--core-grpc=https://{{ .Release.Name }}-agent-core:50051"{{ if .Values.base.jaeger.enabled }}
113113
- "--jaeger={{ include "jaeger_url" . }}"{{ end }}{{ if .Values.eventing.enabled }}

chart/templates/mayastor/agents/core/agent-core-service.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ metadata:
77
{{ include "label_prefix" . }}/release: {{ .Release.Name }}
88
{{ include "label_prefix" . }}/version: {{ .Chart.Version }}
99
spec:
10+
{{- include "service_ip_family" . | nindent 2 }}
1011
selector:
1112
app: agent-core
1213
{{ include "label_prefix" . }}/release: {{ .Release.Name }}

chart/templates/mayastor/apis/api-rest-deployment.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ spec:
4747
args:
4848
- "--dummy-certificates"
4949
- "--no-auth"
50-
- "--http=[::]:8081"
50+
- "--https=[{{ include "bind_address" . }}]:8080"
51+
- "--http=[{{ include "bind_address" . }}]:8081"
5152
- "--request-timeout={{ .Values.base.default_req_timeout }}"{{ if .Values.base.jaeger.enabled }}
5253
- "--jaeger={{ include "jaeger_url" . }}"{{ end }}
5354
- "--core-grpc=https://{{ .Release.Name }}-agent-core:50051"

chart/templates/mayastor/apis/api-rest-service.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ metadata:
77
{{ include "label_prefix" . }}/release: {{ .Release.Name }}
88
{{ include "label_prefix" . }}/version: {{ .Chart.Version }}
99
spec:
10+
{{- include "service_ip_family" . | nindent 2 }}
1011
type: {{ .Values.apis.rest.service.type }}
1112
selector:
1213
app: api-rest

chart/templates/mayastor/io/io-engine-daemonset.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ spec:
153153
protocol: TCP
154154
name: metrics
155155
args:
156-
- "--metrics-endpoint=[::]:{{ default 9502 .Values.base.metrics.port }}"
156+
- "--metrics-endpoint=[{{ include "bind_address" . }}]:{{ default 9502 .Values.base.metrics.port }}"
157157
- "--grpc-port={{ default 10124 .Values.io_engine.port }}"
158158
- "--fmt-style={{ include "logFormat" . }}"
159159
- "--ansi-colors={{ .Values.base.logging.color }}"

chart/templates/mayastor/metrics/metrics-exporter-io-engine-service.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ metadata:
88
{{ include "label_prefix" . }}/release: {{ .Release.Name }}
99
{{ include "label_prefix" . }}/version: {{ .Chart.Version }}
1010
spec:
11+
{{- include "service_ip_family" . | nindent 2 }}
1112
ports:
1213
- name: metrics
1314
port: 9502

chart/templates/mayastor/obs/stats-service.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ metadata:
88
{{ include "label_prefix" . }}/release: {{ .Release.Name }}
99
{{ include "label_prefix" . }}/version: {{ .Chart.Version }}
1010
spec:
11+
{{- include "service_ip_family" . | nindent 2 }}
1112
ports:
1213
- port: 9090
1314
name: https

chart/values.yaml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,8 @@ earlyEvictionTolerations:
5555
# If any component has tolerations set, then it would override this value.
5656
# For external components like etcd, jaeger and loki, tolerations can only be set at component level.
5757
tolerations: [ ]
58+
# -- IP family for services and bind addresses. Valid values: "ipv4", "ipv6", "both" (default).
59+
ipFamily: "both"
5860
base:
5961
# -- Request timeout for rest & core agents
6062
default_req_timeout: 5s

0 commit comments

Comments
 (0)