Skip to content

Commit d2030be

Browse files
committed
fix(mariadb): always enable replication for consistent service naming
Enable replication unconditionally regardless of replica count. Previously, single-replica instances created a general service without -primary/-secondary suffixes, causing dashboard and backup-cronjob to reference non-existent services. Also fix duplicate YAML key in backup-cronjob template. BREAKING CHANGE: Single-replica MariaDB instances will now have service names with -primary/-secondary suffixes instead of the bare instance name. Applications connecting via the old service DNS name need to be updated. Assisted-By: Claude AI Signed-off-by: Kirill Ilin <[email protected]>
1 parent 7c26bea commit d2030be

2 files changed

Lines changed: 1 addition & 9 deletions

File tree

‎packages/apps/mariadb/templates/backup-cronjob.yaml‎

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@ spec:
1313
jobTemplate:
1414
spec:
1515
backoffLimit: 2
16-
template:
17-
spec:
18-
restartPolicy: OnFailure
1916
template:
2017
metadata:
2118
annotations:

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

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,11 @@ spec:
2929
- {{ .Release.Name }}
3030
topologyKey: "kubernetes.io/hostname"
3131

32-
{{- if gt (int .Values.replicas) 1 }}
3332
replication:
3433
enabled: true
3534
#primary:
3635
# podIndex: 0
3736
# automaticFailover: true
38-
{{- end }}
3937

4038
podMetadata:
4139
labels:
@@ -65,9 +63,6 @@ spec:
6563
metadata:
6664
labels:
6765
app.kubernetes.io/instance: {{ $.Release.Name }}
68-
{{- if and .Values.external (eq (int .Values.replicas) 1) }}
69-
type: LoadBalancer
70-
{{- end }}
7166
storage:
7267
size: {{ .Values.size }}
7368
resizeInUseVolumes: true
@@ -76,7 +71,7 @@ spec:
7671
storageClassName: {{ . }}
7772
{{- end }}
7873

79-
{{- if and .Values.external (gt (int .Values.replicas) 1) }}
74+
{{- if .Values.external }}
8075
primaryService:
8176
type: LoadBalancer
8277
{{- end }}

0 commit comments

Comments
 (0)