Files
seclusion/deploy/k8s/web-ksvc.yaml
Charile Zhou 7889037b0e
Some checks failed
Deploy / Build and Push Images (push) Failing after 1m1s
Deploy / Deploy to Knative (push) Has been skipped
feat(ci): 集成 Harbor 镜像仓库
- 使用 secrets.IMAGE_REGISTRY 配置仓库地址
- 使用 Harbor Robot 账号进行镜像推送认证
- Knative Service 添加 harbor-registry-secret 拉取认证
- 支持动态替换镜像仓库地址和标签占位符
2026-01-22 22:31:21 +08:00

45 lines
1.2 KiB
YAML

apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: seclusion-web
namespace: seclusion
labels:
app: seclusion-web
spec:
template:
metadata:
annotations:
# 最小实例数(设为 1 避免冷启动,设为 0 允许缩容到零)
autoscaling.knative.dev/min-scale: "1"
# 最大实例数
autoscaling.knative.dev/max-scale: "10"
# 每个实例的并发请求数
autoscaling.knative.dev/target: "100"
spec:
imagePullSecrets:
- name: harbor-registry-secret
containerConcurrency: 0
containers:
- name: web
image: IMAGE_REGISTRY_PLACEHOLDER/tegical/seclusion-web:IMAGE_TAG_PLACEHOLDER
ports:
- containerPort: 3000
envFrom:
- configMapRef:
name: seclusion-config
- secretRef:
name: seclusion-secret
resources:
requests:
memory: "256Mi"
cpu: "100m"
limits:
memory: "512Mi"
cpu: "500m"
readinessProbe:
httpGet:
path: /
port: 3000
initialDelaySeconds: 5
periodSeconds: 5