phase 5 part 4: java-spring awareness, k8s basics with validated manifests, run_examples supports single-file Java

This commit is contained in:
Shikui Wang committed 2026-10-23 16:42:04 +08:00
1 parent 075872e31e
commit f695bbd7cc
18 files changed
+1192 -23

No files matched your search

@@ -0,0 +1,33 @@
# 按 CPU 自动扩缩容。AI 服务多为 I/O 等待,CPU 不一定能反映负载,可改用自定义指标(并发请求数、队列长度)
apiVersion: autoscaling/v2
kind: HorizontalPodAutoscaler
metadata:
name: agent-api
spec:
scaleTargetRef:
apiVersion: apps/v1
kind: Deployment
name: agent-api
minReplicas: 3
maxReplicas: 10
metrics:
- type: Resource
resource:
name: cpu
target:
type: Utilization
averageUtilization: 70
behavior:
scaleDown:
stabilizationWindowSeconds: 300 # 缩容慢一点,避免抖动
---
# 节点维护(驱逐)时至少保留 2 个可用 Pod
apiVersion: policy/v1
kind: PodDisruptionBudget
metadata:
name: agent-api
spec:
minAvailable: 2
selector:
matchLabels:
app.kubernetes.io/name: agent-api