- configmap 增加计价表与上报地址,改价不必重新发版 - lpt-ai 增加 LPT_AI_REPORT_URL/TOKEN,lpt-be 增加上报入站令牌 - 新增白名单变量,共用一个可选 secret key
109 lines
3.2 KiB
YAML
109 lines
3.2 KiB
YAML
apiVersion: apps/v1
|
||
kind: Deployment
|
||
metadata:
|
||
name: lpt-ai
|
||
namespace: lpt-prod
|
||
labels:
|
||
app: lpt-ai
|
||
spec:
|
||
replicas: 1
|
||
selector:
|
||
matchLabels:
|
||
app: lpt-ai
|
||
strategy:
|
||
type: RollingUpdate
|
||
rollingUpdate:
|
||
maxSurge: 25%
|
||
maxUnavailable: 25%
|
||
template:
|
||
metadata:
|
||
labels:
|
||
app: lpt-ai
|
||
spec:
|
||
imagePullSecrets:
|
||
- name: regcred
|
||
containers:
|
||
- name: lpt-ai
|
||
image: 192.168.123.199:5000/lpt-ai:prod
|
||
imagePullPolicy: IfNotPresent
|
||
ports:
|
||
- containerPort: 5199
|
||
env:
|
||
- name: PORT
|
||
valueFrom:
|
||
configMapKeyRef:
|
||
name: lpt-config
|
||
key: PORT
|
||
- name: LLM_API_URL
|
||
valueFrom:
|
||
configMapKeyRef:
|
||
name: lpt-config
|
||
key: LLM_API_URL
|
||
- name: LLM_MODEL
|
||
valueFrom:
|
||
configMapKeyRef:
|
||
name: lpt-config
|
||
key: LLM_MODEL
|
||
- name: LLM_TIMEOUT_MS
|
||
valueFrom:
|
||
configMapKeyRef:
|
||
name: lpt-config
|
||
key: LLM_TIMEOUT_MS
|
||
- name: LLM_API_KEY
|
||
valueFrom:
|
||
secretKeyRef:
|
||
name: lpt-secrets
|
||
key: llm-api-key
|
||
# 安全-03:入站令牌。optional 表示 secret 里没有这个 key 时 Pod 仍能启动
|
||
# (此时 /ai/* 与 /admin 不校验令牌),加上 key 即可收紧。
|
||
- name: LPT_AI_TOKEN
|
||
valueFrom:
|
||
secretKeyRef:
|
||
name: lpt-secrets
|
||
key: lpt-ai-token
|
||
optional: true
|
||
# 用量上报(lpt-ai → lpt-be):地址为空时不上报,只保留本地面板
|
||
- name: LPT_AI_REPORT_URL
|
||
valueFrom:
|
||
configMapKeyRef:
|
||
name: lpt-config
|
||
key: LPT_AI_REPORT_URL
|
||
# 与 lpt-be 的 lpt.ai-usage.report-token 共用一个 secret key;
|
||
# optional 表示没设也能启动(此时 lpt-be 不校验上报令牌)
|
||
- name: LPT_AI_REPORT_TOKEN
|
||
valueFrom:
|
||
secretKeyRef:
|
||
name: lpt-secrets
|
||
key: lpt-ai-report-token
|
||
optional: true
|
||
resources:
|
||
requests:
|
||
cpu: 100m
|
||
memory: 128Mi
|
||
limits:
|
||
cpu: 500m
|
||
memory: 512Mi
|
||
livenessProbe:
|
||
httpGet:
|
||
path: /health
|
||
port: 5199
|
||
initialDelaySeconds: 10
|
||
periodSeconds: 15
|
||
timeoutSeconds: 5
|
||
failureThreshold: 3
|
||
readinessProbe:
|
||
httpGet:
|
||
path: /health
|
||
port: 5199
|
||
initialDelaySeconds: 5
|
||
periodSeconds: 5
|
||
timeoutSeconds: 3
|
||
failureThreshold: 3
|
||
volumeMounts:
|
||
- name: lpt-logs
|
||
mountPath: /app/data
|
||
volumes:
|
||
- name: lpt-logs
|
||
persistentVolumeClaim:
|
||
claimName: lpt-logs
|