Skip to content

Commit 6732205

Browse files
authored
Create LoadBalancer service for single-node MySQL (#1113)
## Changelog ``` [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. ``` <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit - **New Features** - Improved handling of external service exposure for MySQL deployments, with refined logic for LoadBalancer configuration based on the number of replicas. - **Chores** - Updated MySQL chart version to 0.8.2. - Adjusted version mapping to reflect the latest changes. <!-- end of auto-generated comment: release notes by coderabbit.ai --> Resolves #1095
2 parents 60dee45 + 848abc4 commit 6732205

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)