83 lines
2.0 KiB
YAML
Executable File
83 lines
2.0 KiB
YAML
Executable File
# 方案1:使用kubeconfig Secret部署(推荐用于开发/测试)
|
|
apiVersion: apps/v1
|
|
kind: Deployment
|
|
metadata:
|
|
name: agent-manager
|
|
namespace: default
|
|
labels:
|
|
app: agent-manager
|
|
spec:
|
|
replicas: 1
|
|
selector:
|
|
matchLabels:
|
|
app: agent-manager
|
|
template:
|
|
metadata:
|
|
labels:
|
|
app: agent-manager
|
|
spec:
|
|
# 使用我们创建的ServiceAccount(即使我们也挂载了kubeconfig作为备份)
|
|
serviceAccountName: agent-manager
|
|
imagePullSecrets:
|
|
- name: acr-secret
|
|
containers:
|
|
- name: agent-manager
|
|
image: agnettaiji.azurecr.io/agent-manager:latest
|
|
imagePullPolicy: Always
|
|
ports:
|
|
- containerPort: 8000
|
|
name: http
|
|
env:
|
|
- name: NAMESPACE
|
|
value: "ai-agents"
|
|
- name: SERVICE_PORT
|
|
value: "8000"
|
|
- name: SERVICE_HOST
|
|
value: "0.0.0.0"
|
|
- name: KUBECONFIG_PATH
|
|
value: "/root/.kube/config"
|
|
resources:
|
|
requests:
|
|
cpu: 200m
|
|
memory: 256Mi
|
|
limits:
|
|
cpu: 1000m
|
|
memory: 1Gi
|
|
volumeMounts:
|
|
- name: kubeconfig
|
|
mountPath: /root/.kube
|
|
readOnly: true
|
|
livenessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: 8000
|
|
initialDelaySeconds: 30
|
|
periodSeconds: 10
|
|
readinessProbe:
|
|
httpGet:
|
|
path: /
|
|
port: 8000
|
|
initialDelaySeconds: 10
|
|
periodSeconds: 5
|
|
volumes:
|
|
- name: kubeconfig
|
|
secret:
|
|
secretName: kubeconfig-secret
|
|
---
|
|
apiVersion: v1
|
|
kind: Service
|
|
metadata:
|
|
name: agent-manager
|
|
namespace: default
|
|
labels:
|
|
app: agent-manager
|
|
spec:
|
|
type: ClusterIP
|
|
ports:
|
|
- port: 8000
|
|
targetPort: 8000
|
|
protocol: TCP
|
|
name: http
|
|
selector:
|
|
app: agent-manager
|