Create LoadBalancer service for single-node MySQL

[mysql] Bugfix: external=true did not work for MySQL deployed with a
single replica, since the MariaDB operator does not create separate
primary and secondary services for a single-node DB. A special condition
is added to make the "all-node" service a LoadBalancer if external=true
and replicas=1.

Signed-off-by: Timofei Larkin <lllamnyp@gmail.com>
This commit is contained in:
Timofei Larkin
2025-06-25 14:24:43 +03:00
parent 4369b03141
commit 848abc4bd1
3 changed files with 7 additions and 4 deletions

View File

@@ -16,7 +16,7 @@ type: application
# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.8.1
version: 0.8.2
# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to

View File

@@ -61,7 +61,9 @@ spec:
metadata:
labels:
app.kubernetes.io/instance: {{ $.Release.Name }}
{{- if and .Values.external (eq (int .Values.replicas) 1) }}
type: LoadBalancer
{{- end }}
storage:
size: {{ .Values.size }}
resizeInUseVolumes: true
@@ -70,7 +72,7 @@ spec:
storageClassName: {{ . }}
{{- end }}
{{- if .Values.external }}
{{- if and .Values.external (gt (int .Values.replicas) 1) }}
primaryService:
type: LoadBalancer
{{- end }}

View File

@@ -63,7 +63,8 @@ mysql 0.6.0 93bdf411
mysql 0.7.0 6130f43d
mysql 0.7.1 632224a3
mysql 0.8.0 62cb694d
mysql 0.8.1 HEAD
mysql 0.8.1 4369b031
mysql 0.8.2 HEAD
nats 0.1.0 e9716091
nats 0.2.0 6c5cf5bf
nats 0.3.0 78366f19