Files
agent_management/k8s/deploy-with-kubeconfig.sh
2026-01-05 12:44:28 +00:00

49 lines
1.3 KiB
Bash
Executable File
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.
#!/bin/bash
# 部署脚本 - 使用kubeconfig Secret方式
echo "开始部署Agent Manager (使用Kubeconfig Secret)..."
# 1. 创建命名空间
echo "1. 创建ai-agents命名空间..."
kubectl apply -f k8s/namespace.yaml
# 2. 创建ACR访问密钥
echo "2. 创建ACR访问密钥..."
if [ ! -f "k8s/acr-secret.yaml" ]; then
echo "生成ACR Secret..."
./k8s/create-acr-secret.sh
fi
kubectl apply -f k8s/acr-secret.yaml
# 3. 创建kubeconfig Secret
echo "3. 创建kubeconfig Secret..."
if [ ! -f "k8s/kubeconfig-secret.yaml" ]; then
echo "生成kubeconfig Secret..."
./k8s/create-kubeconfig-secret.sh
fi
kubectl apply -f k8s/kubeconfig-secret.yaml
# 4. 部署Agent Manager服务(使用kubeconfig)
echo "4. 部署Agent Manager..."
kubectl apply -f k8s/deployment-with-kubeconfig.yaml
# 5. 等待部署完成
echo "5. 等待Pod就绪..."
kubectl wait --for=condition=ready pod -l app=agent-manager -n default --timeout=120s
# 6. 显示服务状态
echo ""
echo "✅ 部署完成!"
echo ""
echo "服务状态:"
kubectl get pods -n default -l app=agent-manager
echo ""
echo "服务信息:"
kubectl get svc -n default -l app=agent-manager
echo ""
echo "查看日志:"
echo "kubectl logs -n default -l app=agent-manager -f"
echo ""
echo "访问服务:"
echo "kubectl port-forward -n default svc/agent-manager 8000:8000"