Files
agent_management/k8s/agent-manager-deployment.yaml
T
elipitc 17937ecfd3 Merge remote-tracking branch 'origin/master'
# Conflicts:
#	app.py
#	k8s/agent-manager-configmap.yaml
2026-05-31 18:04:07 +08:00

119 lines
2.9 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: apps/v1
kind: Deployment
metadata:
name: agent-manager
namespace: agent-manager
labels:
app: agent-manager
spec:
replicas: 2
selector:
matchLabels:
app: agent-manager
template:
metadata:
labels:
app: agent-manager
spec:
# 使用专用的 ServiceAccount
serviceAccountName: agent-manager
# ARM 架构节点选择器(确保 Pod 调度到 ARM64 节点)
nodeSelector:
kubernetes.io/arch: arm64
# 容忍度(如果 ARM64 节点有污点,取消注释以下配置)
# tolerations:
# - key: "kubernetes.io/arch"
# operator: "Equal"
# value: "arm64"
# effect: "NoSchedule"
containers:
- name: agent-manager
image: agnettaiji.azurecr.io/agent-manager:latest-arm64
imagePullPolicy: Always
ports:
- containerPort: 8000
name: http
protocol: TCP
# 环境变量 - 从 ConfigMap
envFrom:
- configMapRef:
name: agent-manager-config
# 环境变量 - 从 Secret
env:
- name: AZURE_TENANT_ID
valueFrom:
secretKeyRef:
name: agent-manager-secret
key: AZURE_TENANT_ID
- name: AZURE_CLIENT_ID
valueFrom:
secretKeyRef:
name: agent-manager-secret
key: AZURE_CLIENT_ID
- name: AZURE_CLIENT_SECRET
valueFrom:
secretKeyRef:
name: agent-manager-secret
key: AZURE_CLIENT_SECRET
# Gitee 凭据
- name: GITEE_TOKEN
valueFrom:
secretKeyRef:
name: agent-manager-secret
key: GITEE_TOKEN
- name: GITEE_PASSWORD
valueFrom:
secretKeyRef:
name: agent-manager-secret
key: GITEE_PASSWORD
# 挂载 kubeconfig(用于管理其他 Agent)
volumeMounts:
- name: kubeconfig
mountPath: /root/.kube
readOnly: true
# 资源限制
resources:
requests:
memory: "256Mi"
cpu: "200m"
limits:
memory: "512Mi"
cpu: "500m"
# 健康检查
livenessProbe:
httpGet:
path: /
port: 8000
initialDelaySeconds: 30
periodSeconds: 30
timeoutSeconds: 5
failureThreshold: 3
readinessProbe:
httpGet:
path: /
port: 8000
initialDelaySeconds: 10
periodSeconds: 10
timeoutSeconds: 5
failureThreshold: 3
volumes:
- name: kubeconfig
secret:
secretName: kubeconfig-secret
optional: true
# 使用 ACR 拉取镜像的凭据
imagePullSecrets:
- name: acr-secret