Files
seclusion/deploy/k8s/api-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
Raw Permalink 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:
imagePullSecrets:
- name: harbor-registry-secret
containerConcurrency: 0
containers:
- name: api
image: IMAGE_REGISTRY_PLACEHOLDER/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