fix(k8s): 同步 local 模式数据路径为 /app/sqlite3.db 与二进制同级

- deployment/quick-deploy: PVC 挂载 sqlite3.db/redka.db 到 /app/,含旧 data/ 迁移
- configmap 与 run.sh 状态输出对齐新路径
- README 补充 local 模式说明
This commit is contained in:
Logan.Li committed 2026-06-26 16:19:03 +08:00
1 parent d27a2e6cbe
commit 8df0acb338
7 files changed
+71 -10

No files matched your search

+25 -1
View File
@@ -37,6 +37,25 @@ spec:
hostNetwork: true
dnsPolicy: ClusterFirstWithHostNet
enableServiceLinks: false
# 首次部署时在 PVC 中预创建库文件,避免 subPath 挂载成目录 // Logan.Li
initContainers:
- name: init-local-db
image: busybox:1.36
command:
- sh
- -c
- |
if [ -f /vol/data/sqlite3.db ] && [ ! -f /vol/sqlite3.db ]; then
cp /vol/data/sqlite3.db /vol/sqlite3.db
fi
if [ -f /vol/data/redka/redka.db ] && [ ! -f /vol/redka.db ]; then
cp /vol/data/redka/redka.db /vol/redka.db
fi
[ -f /vol/sqlite3.db ] || install -m 644 /dev/null /vol/sqlite3.db
[ -f /vol/redka.db ] || install -m 644 /dev/null /vol/redka.db
volumeMounts:
- name: data
mountPath: /vol
containers:
- name: aiops
image: 10.10.10.72/library/aiops:embed
@@ -77,8 +96,13 @@ spec:
readOnly: true
- name: uploads
mountPath: /app/uploads
# local 模式:sqlite3.db / redka.db 与 /app/aiops 同级持久化 // Logan.Li
- name: data
mountPath: /app/data
mountPath: /app/sqlite3.db
subPath: sqlite3.db
- name: data
mountPath: /app/redka.db
subPath: redka.db
readinessProbe:
httpGet: