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 <stitch14@yandex.ru>
This commit is contained in:
parent
7c26bea81e
commit
d2030bef87
2 changed files with 1 additions and 9 deletions
|
|
@ -13,9 +13,6 @@ spec:
|
|||
jobTemplate:
|
||||
spec:
|
||||
backoffLimit: 2
|
||||
template:
|
||||
spec:
|
||||
restartPolicy: OnFailure
|
||||
template:
|
||||
metadata:
|
||||
annotations:
|
||||
|
|
|
|||
|
|
@ -29,13 +29,11 @@ spec:
|
|||
- {{ .Release.Name }}
|
||||
topologyKey: "kubernetes.io/hostname"
|
||||
|
||||
{{- if gt (int .Values.replicas) 1 }}
|
||||
replication:
|
||||
enabled: true
|
||||
#primary:
|
||||
# podIndex: 0
|
||||
# automaticFailover: true
|
||||
{{- end }}
|
||||
|
||||
podMetadata:
|
||||
labels:
|
||||
|
|
@ -65,9 +63,6 @@ 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
|
||||
|
|
@ -76,7 +71,7 @@ spec:
|
|||
storageClassName: {{ . }}
|
||||
{{- end }}
|
||||
|
||||
{{- if and .Values.external (gt (int .Values.replicas) 1) }}
|
||||
{{- if .Values.external }}
|
||||
primaryService:
|
||||
type: LoadBalancer
|
||||
{{- end }}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue