Files
seclusion/deploy/k8s/api-ksvc.yaml
charilezhou 08bd6397c8 ci: 添加 Gitea Actions CI/CD 和 Knative 部署配置
- 添加 CI workflow(PR 构建检查)
- 添加 Deploy workflow(main 分支自动部署)
- 添加 Web/API 多阶段 Dockerfile
- 添加 Knative Service 配置(自动扩缩容)
- 添加 K8s ConfigMap、Secret、Namespace 配置
- 添加 .dockerignore 优化构建

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-22 17:38:28 +08:00

43 lines
1.1 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: seclusion-api
namespace: seclusion
labels:
app: seclusion-api
spec:
template:
metadata:
annotations:
# 最小实例数API 服务建议保持至少 1 个实例)
autoscaling.knative.dev/min-scale: "1"
# 最大实例数
autoscaling.knative.dev/max-scale: "10"
# 每个实例的并发请求数
autoscaling.knative.dev/target: "100"
spec:
containerConcurrency: 0
containers:
- name: api
image: gitea.tegical.world/tegical/seclusion-api:IMAGE_TAG_PLACEHOLDER
ports:
- containerPort: 4000
envFrom:
- configMapRef:
name: seclusion-config
- secretRef:
name: seclusion-secret
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "500m"
readinessProbe:
httpGet:
path: /api/health
port: 4000
initialDelaySeconds: 5
periodSeconds: 5