init
This commit is contained in:
6
charts/dbiz-springboot/Chart.yaml
Normal file
6
charts/dbiz-springboot/Chart.yaml
Normal file
@@ -0,0 +1,6 @@
|
||||
apiVersion: v2
|
||||
name: dbiz-springboot
|
||||
description: Generic chart for DBIZ Spring Boot stateless services (env-agnostic)
|
||||
type: application
|
||||
version: 0.1.0
|
||||
appVersion: "1.0"
|
||||
9
charts/dbiz-springboot/templates/_helpers.tpl
Normal file
9
charts/dbiz-springboot/templates/_helpers.tpl
Normal file
@@ -0,0 +1,9 @@
|
||||
{{- define "svc.name" -}}
|
||||
{{- .Release.Name -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- define "svc.labels" -}}
|
||||
app: {{ .Release.Name }}
|
||||
app.kubernetes.io/name: {{ .Release.Name }}
|
||||
app.kubernetes.io/managed-by: {{ .Release.Service }}
|
||||
{{- end -}}
|
||||
51
charts/dbiz-springboot/templates/deployment.yaml
Normal file
51
charts/dbiz-springboot/templates/deployment.yaml
Normal file
@@ -0,0 +1,51 @@
|
||||
apiVersion: apps/v1
|
||||
kind: Deployment
|
||||
metadata:
|
||||
name: {{ include "svc.name" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "svc.labels" . | nindent 4 }}
|
||||
spec:
|
||||
replicas: {{ .Values.replicaCount }}
|
||||
selector:
|
||||
matchLabels:
|
||||
app: {{ .Release.Name }}
|
||||
template:
|
||||
metadata:
|
||||
labels:
|
||||
{{- include "svc.labels" . | nindent 8 }}
|
||||
spec:
|
||||
containers:
|
||||
- name: {{ include "svc.name" . }}
|
||||
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
||||
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
||||
ports:
|
||||
- containerPort: {{ .Values.service.port }}
|
||||
env:
|
||||
{{- range $k, $v := .Values.env }}
|
||||
- name: {{ $k }}
|
||||
value: {{ $v | quote }}
|
||||
{{- end }}
|
||||
{{- range $k := .Values.secretKeys }}
|
||||
- name: {{ $k }}
|
||||
valueFrom:
|
||||
secretKeyRef:
|
||||
name: {{ $.Release.Name }}-secret
|
||||
key: {{ $k }}
|
||||
{{- end }}
|
||||
readinessProbe:
|
||||
httpGet:
|
||||
path: {{ .Values.probe.path }}
|
||||
port: {{ .Values.service.port }}
|
||||
initialDelaySeconds: {{ .Values.probe.initialDelaySeconds }}
|
||||
periodSeconds: {{ .Values.probe.periodSeconds }}
|
||||
failureThreshold: {{ .Values.probe.failureThreshold }}
|
||||
livenessProbe:
|
||||
httpGet:
|
||||
path: {{ .Values.probe.path }}
|
||||
port: {{ .Values.service.port }}
|
||||
initialDelaySeconds: {{ add .Values.probe.initialDelaySeconds 60 }}
|
||||
periodSeconds: {{ .Values.probe.periodSeconds }}
|
||||
failureThreshold: {{ .Values.probe.failureThreshold }}
|
||||
resources:
|
||||
{{- toYaml .Values.resources | nindent 12 }}
|
||||
22
charts/dbiz-springboot/templates/ingress.yaml
Normal file
22
charts/dbiz-springboot/templates/ingress.yaml
Normal file
@@ -0,0 +1,22 @@
|
||||
{{- if .Values.ingress.enabled }}
|
||||
apiVersion: networking.k8s.io/v1
|
||||
kind: Ingress
|
||||
metadata:
|
||||
name: {{ include "svc.name" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "svc.labels" . | nindent 4 }}
|
||||
spec:
|
||||
ingressClassName: {{ .Values.ingress.className }}
|
||||
rules:
|
||||
- host: {{ .Values.ingress.host }}
|
||||
http:
|
||||
paths:
|
||||
- path: /
|
||||
pathType: Prefix
|
||||
backend:
|
||||
service:
|
||||
name: {{ include "svc.name" . }}
|
||||
port:
|
||||
number: {{ .Values.service.port }}
|
||||
{{- end }}
|
||||
15
charts/dbiz-springboot/templates/service.yaml
Normal file
15
charts/dbiz-springboot/templates/service.yaml
Normal file
@@ -0,0 +1,15 @@
|
||||
apiVersion: v1
|
||||
kind: Service
|
||||
metadata:
|
||||
name: {{ include "svc.name" . }}
|
||||
namespace: {{ .Release.Namespace }}
|
||||
labels:
|
||||
{{- include "svc.labels" . | nindent 4 }}
|
||||
spec:
|
||||
type: ClusterIP
|
||||
selector:
|
||||
app: {{ .Release.Name }}
|
||||
ports:
|
||||
- port: {{ .Values.service.port }}
|
||||
targetPort: {{ .Values.service.port }}
|
||||
protocol: TCP
|
||||
36
charts/dbiz-springboot/values.yaml
Normal file
36
charts/dbiz-springboot/values.yaml
Normal file
@@ -0,0 +1,36 @@
|
||||
# Default values — mỗi service override trong envs/<env>/values/<service>.yaml
|
||||
replicaCount: 1
|
||||
|
||||
image:
|
||||
repository: "" # bắt buộc override
|
||||
tag: "latest"
|
||||
pullPolicy: Always
|
||||
|
||||
service:
|
||||
port: 8080
|
||||
|
||||
# Health probe — app chỉ có /actuator/health (aggregate)
|
||||
probe:
|
||||
path: /actuator/health
|
||||
initialDelaySeconds: 60
|
||||
periodSeconds: 10
|
||||
failureThreshold: 30 # cho phép start chậm (Liquibase migrate)
|
||||
|
||||
# Map env tự do — KHÔNG fix tên (mỗi service tên env khác nhau)
|
||||
env: {}
|
||||
|
||||
# Danh sách key đọc từ Secret <release>-secret
|
||||
secretKeys: []
|
||||
|
||||
resources:
|
||||
requests:
|
||||
memory: "512Mi"
|
||||
cpu: "250m"
|
||||
limits:
|
||||
memory: "2Gi"
|
||||
cpu: "1"
|
||||
|
||||
ingress:
|
||||
enabled: true
|
||||
className: traefik
|
||||
host: "" # override per-service
|
||||
Reference in New Issue
Block a user