-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathservice.yaml
More file actions
63 lines (61 loc) · 1.77 KB
/
Copy pathservice.yaml
File metadata and controls
63 lines (61 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
apiVersion: serving.knative.dev/v1
kind: Service
metadata:
name: worshipflow
annotations:
run.googleapis.com/ingress: all
run.googleapis.com/execution-environment: gen2
spec:
template:
metadata:
annotations:
# 扩缩容配置
autoscaling.knative.dev/maxScale: "10"
autoscaling.knative.dev/minScale: "0"
# 资源配置
run.googleapis.com/memory: "1Gi"
run.googleapis.com/cpu: "1"
# 网络配置
run.googleapis.com/execution-environment: gen2
spec:
serviceAccountName: worshipflow-service-account # 可选:自定义服务账户
containers:
- image: gcr.io/PROJECT_ID/worshipflow:latest # 替换 PROJECT_ID
ports:
- containerPort: 8080
name: http1
env:
- name: GCS_BUCKET_NAME
value: "PROJECT_ID-worshipflow-data" # 替换 PROJECT_ID
- name: GOOGLE_CLOUD_PROJECT
value: "PROJECT_ID" # 替换 PROJECT_ID
- name: PORT
value: "8080"
# 可选:如果使用API Key而不是服务账户
# - name: GEMINI_API_KEY
# valueFrom:
# secretKeyRef:
# name: gemini-api-key
# key: api-key
resources:
limits:
memory: 1Gi
cpu: 1000m
requests:
memory: 512Mi
cpu: 100m
# 健康检查
livenessProbe:
httpGet:
path: /_stcore/health
port: 8080
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 10
readinessProbe:
httpGet:
path: /_stcore/health
port: 8080
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5