Files
lpt-infra/dev/deployment-lpt-be.yaml
T
admin 18d34f816f feat: 补充用量统计与上报的部署配置
- configmap 增加计价表与上报地址,改价不必重新发版
- lpt-ai 增加 LPT_AI_REPORT_URL/TOKEN,lpt-be 增加上报入站令牌
- 新增白名单变量,共用一个可选 secret key
2026-10-10 18:46:11 +08:00

89 lines
2.6 KiB
YAML

apiVersion: apps/v1
kind: Deployment
metadata:
name: lpt-be
namespace: lpt-dev
labels:
app: lpt-be
spec:
replicas: 1
selector:
matchLabels:
app: lpt-be
strategy:
type: RollingUpdate
rollingUpdate:
maxSurge: 25%
maxUnavailable: 25%
template:
metadata:
labels:
app: lpt-be
spec:
imagePullSecrets:
- name: regcred
containers:
- name: lpt-be
image: 192.168.123.199:5000/lpt-be:dev
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8888
env:
- name: SPRING_PROFILES_ACTIVE
value: dev
- name: SPRING_DATASOURCE_URL
valueFrom:
configMapKeyRef:
name: lpt-config
key: SPRING_DATASOURCE_URL
- name: SPRING_DATASOURCE_USERNAME
value: root
- name: SPRING_DATASOURCE_PASSWORD
valueFrom:
secretKeyRef:
name: lpt-secrets
key: mysql-root-password
- name: LPT_AI-SERVICE_URL
valueFrom:
configMapKeyRef:
name: lpt-config
key: LPT_AI-SERVICE_URL
# 安全-03:与 lpt-ai 共用的入站令牌;secret 里没有该 key 时不影响启动
- name: LPT_AI-SERVICE_TOKEN
valueFrom:
secretKeyRef:
name: lpt-secrets
key: lpt-ai-token
optional: true
# 用量上报入站令牌(与 lpt-ai 的 LPT_AI_REPORT_TOKEN 同一个 secret key);
# 为空表示不校验。该接口在 /internal/** 下,已排除 Sa-Token 登录校验。
- name: LPT_AI-USAGE_REPORT-TOKEN
valueFrom:
secretKeyRef:
name: lpt-secrets
key: lpt-ai-report-token
optional: true
resources:
requests:
cpu: 250m
memory: 512Mi
limits:
cpu: "1"
memory: 1Gi
livenessProbe:
httpGet:
path: /actuator/health
port: 8888
initialDelaySeconds: 60
periodSeconds: 30
timeoutSeconds: 10
failureThreshold: 3
readinessProbe:
httpGet:
path: /actuator/health
port: 8888
initialDelaySeconds: 30
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3