Skip to content

Commit 1d58c18

Browse files
committed
fix(mariadb): use primary service for backups with single replica
When replicas=1, the secondary service has no endpoints because the only pod is the primary. Route backups to the primary service in this case to ensure they work correctly. Assisted-By: Claude AI Signed-off-by: Kirill Ilin <[email protected]>
1 parent d2030be commit 1d58c18

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ spec:
4141
name: {{ .Release.Name }}
4242
key: root-password
4343
- name: MYSQL_HOST
44-
value: {{ .Release.Name }}-secondary
44+
value: "{{ .Release.Name }}-{{ if eq (int .Values.replicas) 1 }}primary{{ else }}secondary{{ end }}"
4545
- name: AWS_ACCESS_KEY_ID
4646
valueFrom:
4747
secretKeyRef:

0 commit comments

Comments
 (0)