Files
cube/apps/notes/k8s/all.yaml
T
Fam Zheng 68671784f6
deploy notes / build-and-deploy (push) Failing after 2m2s
notes: 加一键转飞书文档 (sidecar markdown-to-feishu)
- backend: POST /api/recordings/:id/feishu → 拼 markdown (总结在最上 + 附件链接到转录/录音 + 转写全文) → 写 /data/feishu-tmp/<id>/ → HTTP POST 到 feishu sidecar
- 复用:已有 feishu_doc_id 时 --update 同一个 doc,前端按钮文案变「↻ 重新生成」
- schema 加 feishu_doc_id + feishu_url 两列(ALTER TABLE 兼容旧 db)
- LLM prompt 改:行动项用 markdown checkbox `- [ ] 谁·做什么·何时`
- sidecar apps/notes/feishu: node:20 + python3 + python3-markdown + @larksuite/cli + COPY 自己的 markdown-to-feishu script + FastAPI /convert
- k8s: deployment 加 feishu container 共享 PVC;lark-cli-creds Secret 挂 /root/.lark-cli/config.json
- CI: 主 image --no-cache(cube 规矩),sidecar 保留 layer cache(chromium-free,但 apt/npm 也大)
- 前端: content 头部加「📤 一键转飞书文档」按钮;已转过显示飞书链接 + 按钮变重生成
2026-05-17 22:16:13 +01:00

164 lines
4.0 KiB
YAML

apiVersion: v1
kind: Namespace
metadata:
name: cube-notes
---
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: notes-data
namespace: cube-notes
spec:
accessModes:
- ReadWriteOnce
resources:
requests:
storage: 30Gi
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: notes
namespace: cube-notes
labels:
app: notes
spec:
replicas: 1
strategy:
type: Recreate
selector:
matchLabels:
app: notes
template:
metadata:
labels:
app: notes
spec:
imagePullSecrets:
- name: registry-creds
containers:
- name: notes
image: registry.famzheng.me/mochi/notes:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8080
name: http
env:
- name: DB_PATH
value: /data/app.db
- name: BLOBS_DIR
value: /data/blobs
- name: ASR_URL
value: http://18.159.112.195:8848/v1/audio/transcriptions
- name: LLM_GATEWAY
value: http://3.135.65.204:8848/v1
- name: LLM_MODEL
value: gemma-4-31b-it
- name: PASSPHRASE
valueFrom:
secretKeyRef:
name: notes-creds
key: passphrase
- name: ASR_TOKEN
valueFrom:
secretKeyRef:
name: notes-creds
key: asr_token
- name: LLM_TOKEN
valueFrom:
secretKeyRef:
name: notes-creds
key: llm_token
- name: FEISHU_URL
value: http://localhost:8002
readinessProbe:
httpGet: { path: /healthz, port: http }
initialDelaySeconds: 1
periodSeconds: 5
livenessProbe:
httpGet: { path: /healthz, port: http }
initialDelaySeconds: 5
periodSeconds: 15
resources:
requests: { cpu: 10m, memory: 32Mi }
limits: { cpu: 1000m, memory: 512Mi }
volumeMounts:
- name: data
mountPath: /data
- name: feishu
image: registry.famzheng.me/mochi/notes-feishu:latest
imagePullPolicy: IfNotPresent
ports:
- containerPort: 8002
name: feishu
readinessProbe:
httpGet: { path: /healthz, port: feishu }
initialDelaySeconds: 3
periodSeconds: 10
livenessProbe:
httpGet: { path: /healthz, port: feishu }
initialDelaySeconds: 30
periodSeconds: 30
resources:
requests: { cpu: 20m, memory: 64Mi }
limits: { cpu: 500m, memory: 384Mi }
volumeMounts:
- name: data
mountPath: /data
- name: lark-cli-config
mountPath: /root/.lark-cli
readOnly: false
volumes:
- name: data
persistentVolumeClaim:
claimName: notes-data
- name: lark-cli-config
secret:
secretName: lark-cli-creds
items:
- key: config.json
path: config.json
---
apiVersion: v1
kind: Service
metadata:
name: notes
namespace: cube-notes
spec:
selector:
app: notes
ports:
- name: http
port: 80
targetPort: 8080
---
apiVersion: traefik.io/v1alpha1
kind: Middleware
metadata:
name: bodylimit
namespace: cube-notes
spec:
buffering:
maxRequestBodyBytes: 629145600
---
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: notes
namespace: cube-notes
annotations:
traefik.ingress.kubernetes.io/router.middlewares: cube-notes-bodylimit@kubernetescrd
spec:
ingressClassName: traefik
rules:
- host: notes.famzheng.me
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: notes
port:
number: 80