- 新增 edu-platform 平台级 chart(namespace/configmap/secret/ingress/hpa) - 新增 api-gateway 服务级 chart(完整迁移自原 manifest) - 新增 6 个业务服务 chart 桩(iam/core-edu/content/msg/data-ana/ai) - 删除原 api-gateway-deployment.yaml(已迁移至 helm chart) - 更新 infra/k8s/README.md 为 Helm Chart 管理说明 - 新增 backup-mysql.sh dry-run 测试脚本(17 断言)
78 lines
2.9 KiB
YAML
78 lines
2.9 KiB
YAML
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: {{ include "ai.name" . }}
|
|
namespace: {{ .Values.namespace }}
|
|
labels:
|
|
{{- include "ai.labels" . | nindent 4 }}
|
|
spec:
|
|
replicas: {{ .Values.replicaCount }}
|
|
selector:
|
|
matchLabels:
|
|
{{- include "ai.selectorLabels" . | nindent 6 }}
|
|
strategy:
|
|
type: {{ .Values.strategy.type }}
|
|
rollingUpdate:
|
|
maxSurge: {{ .Values.strategy.maxSurge }}
|
|
maxUnavailable: {{ .Values.strategy.maxUnavailable }}
|
|
template:
|
|
metadata:
|
|
labels:
|
|
{{- include "ai.selectorLabels" . | nindent 8 }}
|
|
app.kubernetes.io/part-of: edu-platform
|
|
app.kubernetes.io/component: ai-gateway
|
|
{{- if .Values.metrics.enabled }}
|
|
annotations:
|
|
prometheus.io/scrape: "true"
|
|
prometheus.io/port: {{ .Values.metrics.port | quote }}
|
|
prometheus.io/path: {{ .Values.metrics.path | quote }}
|
|
{{- end }}
|
|
spec:
|
|
containers:
|
|
- name: {{ include "ai.name" . }}
|
|
image: "{{ .Values.image.repository }}:{{ .Values.image.tag }}"
|
|
imagePullPolicy: {{ .Values.image.pullPolicy }}
|
|
ports:
|
|
- name: http
|
|
containerPort: {{ .Values.service.targetPort }}
|
|
protocol: TCP
|
|
livenessProbe:
|
|
httpGet:
|
|
path: {{ .Values.probes.liveness.path }}
|
|
port: http
|
|
initialDelaySeconds: {{ .Values.probes.liveness.initialDelaySeconds }}
|
|
periodSeconds: {{ .Values.probes.liveness.periodSeconds }}
|
|
timeoutSeconds: {{ .Values.probes.liveness.timeoutSeconds }}
|
|
failureThreshold: {{ .Values.probes.liveness.failureThreshold }}
|
|
readinessProbe:
|
|
httpGet:
|
|
path: {{ .Values.probes.readiness.path }}
|
|
port: http
|
|
initialDelaySeconds: {{ .Values.probes.readiness.initialDelaySeconds }}
|
|
periodSeconds: {{ .Values.probes.readiness.periodSeconds }}
|
|
timeoutSeconds: {{ .Values.probes.readiness.timeoutSeconds }}
|
|
failureThreshold: {{ .Values.probes.readiness.failureThreshold }}
|
|
resources:
|
|
{{- toYaml .Values.resources | nindent 12 }}
|
|
env:
|
|
{{- if .Values.configMap.enabled }}
|
|
{{- range $k, $v := .Values.configMap.data }}
|
|
- name: {{ $k }}
|
|
valueFrom:
|
|
configMapKeyRef:
|
|
name: {{ include "ai.name" $ }}-config
|
|
key: {{ $k }}
|
|
{{- end }}
|
|
{{- end }}
|
|
{{- range $secret := .Values.secretRefs }}
|
|
{{- range $key := $secret.keys }}
|
|
- name: {{ $key }}
|
|
valueFrom:
|
|
secretKeyRef:
|
|
name: {{ $secret.name }}
|
|
key: {{ $key }}
|
|
{{- end }}
|
|
{{- end }}
|
|
securityContext:
|
|
{{- toYaml .Values.securityContext | nindent 12 }}
|