This commit is contained in:
s871077
2026-09-11 10:11:09 +08:00
parent e25c995560
commit 58587d19a8
25 changed files with 1643 additions and 54 deletions
+40
View File
@@ -0,0 +1,40 @@
{{/*
Headless service: stable per-pod DNS for the StatefulSet
(<fullname>-db-0.<fullname>-db-headless). Required by the StatefulSet spec.
*/}}
apiVersion: v1
kind: Service
metadata:
name: {{ include "it-cost-dashboard.fullname" . }}-db-headless
labels:
{{- include "it-cost-dashboard.componentLabels" (dict "ctx" . "component" "db") | nindent 4 }}
spec:
clusterIP: None
ports:
- name: mysql
port: {{ .Values.db.port }}
targetPort: mysql
protocol: TCP
selector:
{{- include "it-cost-dashboard.componentSelectorLabels" (dict "ctx" . "component" "db") | nindent 4 }}
---
{{/*
Normal ClusterIP service. This is what DATABASE_URL and the wait-for-db
initContainer target — simpler than per-pod DNS and sufficient for a
single-primary MySQL.
*/}}
apiVersion: v1
kind: Service
metadata:
name: {{ include "it-cost-dashboard.dbServiceName" . }}
labels:
{{- include "it-cost-dashboard.componentLabels" (dict "ctx" . "component" "db") | nindent 4 }}
spec:
type: ClusterIP
ports:
- name: mysql
port: {{ .Values.db.port }}
targetPort: mysql
protocol: TCP
selector:
{{- include "it-cost-dashboard.componentSelectorLabels" (dict "ctx" . "component" "db") | nindent 4 }}