feat(charts): add service wrapper charts

This commit is contained in:
Haitao Pan 2026-04-02 17:59:59 +08:00
parent 6cbca2e23b
commit 7e4b1061d9
14 changed files with 207 additions and 12 deletions

View File

@ -0,0 +1,6 @@
dependencies:
- name: app-service
repository: file://../app-service
version: 0.1.0
digest: sha256:29102607dbddc890cc60258ec869b75fd9e5f995fc8c5ee1f1a31b046b80e407
generated: "2026-04-02T17:55:26.238504+08:00"

View File

@ -0,0 +1,11 @@
apiVersion: v2
name: accounts-chart
description: Accounts service chart backed by the shared app-service subchart
type: application
version: 0.1.0
appVersion: "1.0.0"
dependencies:
- name: app-service
version: 0.1.0
repository: file://../app-service
alias: service

Binary file not shown.

View File

@ -0,0 +1,25 @@
service:
nameOverride: accounts
containerPort: 8080
service:
port: 80
global:
existingSecretName: accounts-env
repository: ghcr.io/x-evor/accounts
tag: latest
env:
PORT: "8080"
SERVICE_NAME: accounts
HEALTHCHECK_PATH: /healthz
readinessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 10
periodSeconds: 10
livenessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 30
periodSeconds: 20

View File

@ -1,3 +1,22 @@
{{- $global := .Values.global | default dict -}}
{{- $globalRepository := $global.repository | default "" -}}
{{- $globalTag := $global.tag | default "" -}}
{{- $globalEnv := $global.env | default dict -}}
{{- $localEnv := .Values.env | default dict -}}
{{- $env := mergeOverwrite (deepCopy $globalEnv) $localEnv -}}
{{- $existingSecretName := .Values.existingSecretName | default ($global.existingSecretName | default "") -}}
{{- $imageRepository := default $globalRepository .Values.image.repository -}}
{{- $imageTag := default $globalTag .Values.image.tag -}}
{{- $globalEnvFromSecretRefs := $global.envFromSecretRefs | default list -}}
{{- $localEnvFromSecretRefs := .Values.envFromSecretRefs | default list -}}
{{- $envFromSecretRefs := concat $globalEnvFromSecretRefs $localEnvFromSecretRefs -}}
{{- $globalExternalServices := index $global "external-service" | default list -}}
{{- $localExternalServices := index .Values "external-service" | default list -}}
{{- $externalServices := concat $globalExternalServices $localExternalServices -}}
{{- if $externalServices -}}
{{- $_ := set $env "EXTERNAL_SERVICES" (join "," $externalServices) -}}
{{- end -}}
apiVersion: apps/v1
kind: Deployment
metadata:
@ -24,8 +43,8 @@ spec:
{{- toYaml . | nindent 8 }}
{{- end }}
annotations:
{{- if and .Values.reloader.enabled .Values.existingSecretName }}
secret.reloader.stakater.com/reload: {{ default .Values.existingSecretName .Values.reloader.secretMatch | quote }}
{{- if and .Values.reloader.enabled $existingSecretName }}
secret.reloader.stakater.com/reload: {{ default $existingSecretName .Values.reloader.secretMatch | quote }}
{{- end }}
{{- with .Values.podAnnotations }}
{{- toYaml . | nindent 8 }}
@ -50,34 +69,60 @@ spec:
affinity:
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.initContainers }}
initContainers:
{{- toYaml . | nindent 8 }}
{{- end }}
containers:
- name: app
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
image: "{{ $imageRepository }}:{{ $imageTag }}"
imagePullPolicy: {{ .Values.image.pullPolicy }}
{{- with .Values.command }}
command:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- with .Values.args }}
args:
{{- toYaml . | nindent 12 }}
{{- end }}
{{- if .Values.workingDir }}
workingDir: {{ .Values.workingDir | quote }}
{{- end }}
ports:
- name: http
containerPort: {{ .Values.containerPort }}
{{- if .Values.env }}
{{- if $env }}
env:
{{- range $key, $value := .Values.env }}
{{- range $key := keys $env | sortAlpha }}
- name: {{ $key }}
value: {{ $value | quote }}
value: {{ index $env $key | quote }}
{{- end }}
{{- end }}
{{- if or .Values.existingSecretName .Values.envFromSecretRefs }}
{{- if or $existingSecretName $envFromSecretRefs }}
envFrom:
{{- if .Values.existingSecretName }}
{{- if $existingSecretName }}
- secretRef:
name: {{ .Values.existingSecretName }}
name: {{ $existingSecretName }}
{{- end }}
{{- range .Values.envFromSecretRefs }}
{{- range $envFromSecretRefs }}
- secretRef:
name: {{ . }}
{{- end }}
{{- end }}
{{- with .Values.volumeMounts }}
volumeMounts:
{{- toYaml . | nindent 12 }}
{{- end }}
resources:
{{- toYaml .Values.resources | nindent 12 }}
readinessProbe:
{{- toYaml .Values.readinessProbe | nindent 12 }}
livenessProbe:
{{- toYaml .Values.livenessProbe | nindent 12 }}
{{- with .Values.extraContainers }}
{{- toYaml . | nindent 8 }}
{{- end }}
{{- with .Values.volumes }}
volumes:
{{- toYaml . | nindent 8 }}
{{- end }}

View File

@ -4,11 +4,15 @@ fullnameOverride: ""
replicaCount: 1
image:
repository: ghcr.io/example/app
tag: latest
repository: ""
tag: ""
pullPolicy: IfNotPresent
pullSecrets: []
command: []
args: []
workingDir: ""
containerPort: 8080
service:
@ -30,9 +34,23 @@ serviceAccount:
name: ""
annotations: {}
global:
repository: ""
tag: ""
env: {}
existingSecretName: ""
external-service: []
envFromSecretRefs: []
# Local overrides remain available for backwards compatibility.
env: {}
existingSecretName: ""
external-service: []
envFromSecretRefs: []
initContainers: []
extraContainers: []
volumeMounts: []
volumes: []
resources:
requests:

View File

@ -0,0 +1,6 @@
dependencies:
- name: app-service
repository: file://../app-service
version: 0.1.0
digest: sha256:29102607dbddc890cc60258ec869b75fd9e5f995fc8c5ee1f1a31b046b80e407
generated: "2026-04-02T17:55:26.213216+08:00"

View File

@ -0,0 +1,11 @@
apiVersion: v2
name: console-chart
description: Console service chart backed by the shared app-service subchart
type: application
version: 0.1.0
appVersion: "1.0.0"
dependencies:
- name: app-service
version: 0.1.0
repository: file://../app-service
alias: service

Binary file not shown.

View File

@ -0,0 +1,31 @@
service:
nameOverride: console
containerPort: 3000
service:
port: 80
global:
existingSecretName: console-env
repository: ghcr.io/x-evor/console
tag: latest
env:
PORT: "3000"
SERVICE_NAME: console
HEALTHCHECK_PATH: /
DOCS_SERVICE_URL: https://docs.svc.plus
NEXT_PUBLIC_DOCS_BASE_URL: https://docs.svc.plus
external-service:
- docs.svc.plus
- xworkmate.svc.plus
- openclaw-gateway.svc.plus
readinessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 10
periodSeconds: 10
livenessProbe:
httpGet:
path: /
port: http
initialDelaySeconds: 30
periodSeconds: 20

View File

@ -0,0 +1,6 @@
dependencies:
- name: app-service
repository: file://../app-service
version: 0.1.0
digest: sha256:29102607dbddc890cc60258ec869b75fd9e5f995fc8c5ee1f1a31b046b80e407
generated: "2026-04-02T17:55:26.26398+08:00"

View File

@ -0,0 +1,11 @@
apiVersion: v2
name: rag-server-chart
description: RAG server chart backed by the shared app-service subchart
type: application
version: 0.1.0
appVersion: "1.0.0"
dependencies:
- name: app-service
version: 0.1.0
repository: file://../app-service
alias: service

View File

@ -0,0 +1,25 @@
service:
nameOverride: rag-server
containerPort: 8080
service:
port: 80
global:
existingSecretName: rag-server-env
repository: ghcr.io/x-evor/rag-server
tag: latest
env:
PORT: "8080"
SERVICE_NAME: rag-server
HEALTHCHECK_PATH: /healthz
readinessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 10
periodSeconds: 10
livenessProbe:
httpGet:
path: /healthz
port: http
initialDelaySeconds: 30
periodSeconds: 20