Skip to content

Commit 848abc4

Browse files
committed
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 <[email protected]>
1 parent 4369b03 commit 848abc4

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

‎packages/apps/mysql/Chart.yaml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ type: application
1616
# This is the chart version. This version number should be incremented each time you make changes
1717
# to the chart and its templates, including the app version.
1818
# Versions are expected to follow Semantic Versioning (https://semver.org/)
19-
version: 0.8.1
19+
version: 0.8.2
2020

2121
# This is the version number of the application being deployed. This version number should be
2222
# incremented each time you make changes to the application. Versions are not expected to

‎packages/apps/mysql/templates/mariadb.yaml‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ spec:
6161
metadata:
6262
labels:
6363
app.kubernetes.io/instance: {{ $.Release.Name }}
64-
64+
{{- if and .Values.external (eq (int .Values.replicas) 1) }}
65+
type: LoadBalancer
66+
{{- end }}
6567
storage:
6668
size: {{ .Values.size }}
6769
resizeInUseVolumes: true
@@ -70,7 +72,7 @@ spec:
7072
storageClassName: {{ . }}
7173
{{- end }}
7274

73-
{{- if .Values.external }}
75+
{{- if and .Values.external (gt (int .Values.replicas) 1) }}
7476
primaryService:
7577
type: LoadBalancer
7678
{{- end }}

‎packages/apps/versions_map‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ mysql 0.6.0 93bdf411
6363
mysql 0.7.0 6130f43d
6464
mysql 0.7.1 632224a3
6565
mysql 0.8.0 62cb694d
66-
mysql 0.8.1 HEAD
66+
mysql 0.8.1 4369b031
67+
mysql 0.8.2 HEAD
6768
nats 0.1.0 e9716091
6869
nats 0.2.0 6c5cf5bf
6970
nats 0.3.0 78366f19

0 commit comments

Comments
 (0)