MCP服务器部署
MCP Everything Kubernetes部署的GitOps存储库。由ArgoCD管理。
存储库结构
mcp-server-deployments/
├── base/ # Shared namespace resources
│ ├── kustomization.yaml # Kustomize configuration
│ ├── namespace.yaml # mcp-servers namespace
│ ├── resource-quota.yaml # Namespace resource limits
│ ├── limit-range.yaml # Per-pod resource defaults
│ └── network-policy.yaml # Network security rules
├── servers/ # Per-server deployments (auto-generated)
│ └── {server-id}/
│ ├── kustomization.yaml
│ ├── deployment.yaml
│ ├── service.yaml
│ └── ingress.yaml
└── argocd/ # ArgoCD configuration
├── applicationset.yaml # Dynamic server discovery
└── mcp-servers-base.yaml # Base resources Application先决条件
1.Kubernetes集群
- Kubernetes 1.25+,具有:
- nginx入口控制器 - 证书管理器(用于TLS) - 度量服务器(用于HPA)
2.ArgoCD安装
# Create ArgoCD namespace
kubectl create namespace argocd
# Install ArgoCD
kubectl apply -n argocd -f https://raw.githubusercontent.com/argoproj/argo-cd/stable/manifests/install.yaml
# Wait for ArgoCD to be ready
kubectl wait --for=condition=available deployment/argocd-server -n argocd --timeout=300s
# Get initial admin password
kubectl -n argocd get secret argocd-initial-admin-secret -o jsonpath="{.data.password}" | base64 -d3.存储库访问
对于私有存储库,配置ArgoCD存储库凭据:
# Using ArgoCD CLI
argocd repo add https://github.com/4eyedengineer/mcp-server-deployments.git \
--username \
--password
# Or using Kubernetes Secret
kubectl apply -f -
password:
EOF部署
部署基础资源
# Apply the base Application
kubectl apply -f argocd/mcp-servers-base.yaml
# Verify namespace is created
kubectl get namespace mcp-servers部署应用程序集
# Apply the ApplicationSet for dynamic server discovery
kubectl apply -f argocd/applicationset.yaml
# Verify ApplicationSet is created
kubectl get applicationset -n argocd验证部署
# Check ArgoCD Applications
kubectl get applications -n argocd
# Check mcp-servers namespace resources
kubectl get all -n mcp-servers
# Check resource quotas
kubectl describe resourcequota -n mcp-servers
# Check network policies
kubectl get networkpolicy -n mcp-serversGitOps流程
- MCP服务器生成:用户通过MCP Everything平台生成MCP服务器
- 企业部署:平台将服务器清单提交给
servers/{server-id}/ - ArgoCD检测:ApplicationSet检测到新目录
- 自动同步:ArgoCD创建应用程序并部署到集群
- 健康监测:ArgoCD监控部署运行状况
- 自愈:漂移会自动校正
User Request
│
▼
┌────────────────────┐
│ MCP Everything │
│ Platform │
└─────────┬──────────┘
│ Commit manifests
▼
┌────────────────────┐
│ mcp-server- │
│ deployments repo │
└─────────┬──────────┘
│ Git webhook
▼
┌────────────────────┐
│ ArgoCD │
│ ApplicationSet │
└─────────┬──────────┘
│ Auto-sync
▼
┌────────────────────┐
│ Kubernetes │
│ mcp-servers ns │
└────────────────────┘添加新的MCP服务器
MCP Everything平台自动生成服务器清单。手动结构:
# servers/{server-id}/kustomization.yaml
apiVersion: kustomize.config.k8s.io/v1beta1
kind: Kustomization
resources:
- deployment.yaml
- service.yaml
- ingress.yaml看 宿舍_宿舍.md 在清单模板的主存储库中。
资源限制
| 资源 | 请求 | 限制 |
|---|---|---|
| CPU | 100m | 500m |
| 内存 | 128Mi | 256Mi |
命名空间配额允许约100台具有这些限制的服务器。
网络安全
- Ingress:仅来自nginx入口控制器
- 出口:DNS+HTTPS(外部API)
- 内部网络访问:已阻止
故障排除
应用程序不同步
# Force sync
argocd app sync mcp-{server-id}
# Check sync status
argocd app get mcp-{server-id}部署未启动
# Check events
kubectl describe deployment mcp-{server-id} -n mcp-servers
# Check pod logs
kubectl logs -l server-id={server-id} -n mcp-servers
# Check resource quota
kubectl describe resourcequota -n mcp-servers网络问题
# Verify network policy
kubectl describe networkpolicy mcp-servers-network-policy -n mcp-servers
# Test connectivity from pod
kubectl exec -it mcp-{server-id}-xxx -n mcp-servers -- curl -v https://api.example.com相关文件
许可证
MIT许可证-请参阅许可证文件
