- Functional control plan
This commit is contained in:
@@ -92,18 +92,47 @@ deploy_application_services() {
|
||||
wait_for_pods "eveai-dev" "eveai-chat-client" 180
|
||||
}
|
||||
|
||||
deploy_nginx_monitoring() {
|
||||
print_status "Deploying Nginx and monitoring services..."
|
||||
deploy_static_ingress() {
|
||||
print_status "Deploying static files service and Ingress..."
|
||||
|
||||
if kubectl apply -f nginx-monitoring-services.yaml; then
|
||||
print_success "Nginx and monitoring services deployed"
|
||||
# Deploy static files service
|
||||
if kubectl apply -f static-files-service.yaml; then
|
||||
print_success "Static files service deployed"
|
||||
else
|
||||
print_error "Failed to deploy Nginx and monitoring services"
|
||||
print_error "Failed to deploy static files service"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Wait for nginx and monitoring to be ready
|
||||
wait_for_pods "eveai-dev" "nginx" 120
|
||||
# Deploy Ingress
|
||||
if kubectl apply -f eveai-ingress.yaml; then
|
||||
print_success "Ingress deployed"
|
||||
else
|
||||
print_error "Failed to deploy Ingress"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Wait for services to be ready
|
||||
wait_for_pods "eveai-dev" "static-files" 60
|
||||
|
||||
# Wait for Ingress to be ready
|
||||
print_status "Waiting for Ingress to be ready..."
|
||||
kubectl wait --namespace eveai-dev \
|
||||
--for=condition=ready ingress/eveai-ingress \
|
||||
--timeout=120s || print_warning "Ingress might still be starting up"
|
||||
}
|
||||
|
||||
deploy_monitoring_only() {
|
||||
print_status "Deploying monitoring services..."
|
||||
|
||||
if kubectl apply -f monitoring-services.yaml; then
|
||||
print_success "Monitoring services deployed"
|
||||
else
|
||||
print_error "Failed to deploy monitoring services"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Wait for monitoring services
|
||||
wait_for_pods "eveai-dev" "flower" 120
|
||||
wait_for_pods "eveai-dev" "prometheus" 180
|
||||
wait_for_pods "eveai-dev" "grafana" 180
|
||||
}
|
||||
@@ -125,44 +154,49 @@ check_services() {
|
||||
kubectl get pvc -n eveai-dev
|
||||
}
|
||||
|
||||
# Test service connectivity
|
||||
test_connectivity() {
|
||||
print_status "Testing service connectivity..."
|
||||
# Test service connectivity via Ingress
|
||||
test_connectivity_ingress() {
|
||||
print_status "Testing Ingress connectivity..."
|
||||
|
||||
# Test endpoints that should respond
|
||||
# Test Ingress endpoints
|
||||
endpoints=(
|
||||
"http://localhost:3080" # Nginx
|
||||
"http://localhost:3001/healthz/ready" # EveAI App
|
||||
"http://localhost:3003/healthz/ready" # EveAI API
|
||||
"http://localhost:3004/healthz/ready" # Chat Client
|
||||
"http://localhost:3009" # MinIO Console
|
||||
"http://localhost:3010" # Prometheus
|
||||
"http://localhost:3012" # Grafana
|
||||
"http://minty.ask-eve-ai-local.com:3080/admin/"
|
||||
"http://minty.ask-eve-ai-local.com:3080/api/healthz/ready"
|
||||
"http://minty.ask-eve-ai-local.com:3080/chat-client/"
|
||||
"http://minty.ask-eve-ai-local.com:3080/static/"
|
||||
"http://localhost:3009" # MinIO Console (direct)
|
||||
"http://localhost:3010" # Prometheus (direct)
|
||||
"http://localhost:3012" # Grafana (direct)
|
||||
)
|
||||
|
||||
for endpoint in "${endpoints[@]}"; do
|
||||
print_status "Testing $endpoint..."
|
||||
if curl -f -s --max-time 10 "$endpoint" > /dev/null; then
|
||||
print_success "$endpoint is responding"
|
||||
print_success "$endpoint is responding via Ingress"
|
||||
else
|
||||
print_warning "$endpoint is not responding (may still be starting up)"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
# Show connection information
|
||||
show_connection_info() {
|
||||
# Test service connectivity (legacy function for backward compatibility)
|
||||
test_connectivity() {
|
||||
test_connectivity_ingress
|
||||
}
|
||||
|
||||
# Show connection information for Ingress setup
|
||||
show_connection_info_ingress() {
|
||||
echo ""
|
||||
echo "=================================================="
|
||||
print_success "EveAI Dev Cluster deployed successfully!"
|
||||
echo "=================================================="
|
||||
echo ""
|
||||
echo "🌐 Service URLs:"
|
||||
echo "🌐 Service URLs (via Ingress):"
|
||||
echo " Main Application:"
|
||||
echo " • Nginx Proxy: http://minty.ask-eve-ai-local.com:3080"
|
||||
echo " • EveAI App: http://minty.ask-eve-ai-local.com:3001"
|
||||
echo " • EveAI API: http://minty.ask-eve-ai-local.com:3003"
|
||||
echo " • Chat Client: http://minty.ask-eve-ai-local.com:3004"
|
||||
echo " • Main App: http://minty.ask-eve-ai-local.com:3080/admin/"
|
||||
echo " • API: http://minty.ask-eve-ai-local.com:3080/api/"
|
||||
echo " • Chat Client: http://minty.ask-eve-ai-local.com:3080/chat-client/"
|
||||
echo " • Static Files: http://minty.ask-eve-ai-local.com:3080/static/"
|
||||
echo ""
|
||||
echo " Infrastructure:"
|
||||
echo " • Redis: redis://minty.ask-eve-ai-local.com:3006"
|
||||
@@ -181,14 +215,20 @@ show_connection_info() {
|
||||
echo ""
|
||||
echo "🛠️ Management Commands:"
|
||||
echo " • kubectl get all -n eveai-dev"
|
||||
echo " • kubectl get ingress -n eveai-dev"
|
||||
echo " • kubectl logs -f deployment/eveai-app -n eveai-dev"
|
||||
echo " • kubectl describe pod <pod-name> -n eveai-dev"
|
||||
echo " • kubectl describe ingress eveai-ingress -n eveai-dev"
|
||||
echo ""
|
||||
echo "🗂️ Data Persistence:"
|
||||
echo " • Host data path: $HOME/k8s-data/dev/"
|
||||
echo " • Logs path: $HOME/k8s-data/dev/logs/"
|
||||
}
|
||||
|
||||
# Show connection information (legacy function for backward compatibility)
|
||||
show_connection_info() {
|
||||
show_connection_info_ingress
|
||||
}
|
||||
|
||||
# Main execution
|
||||
main() {
|
||||
echo "=================================================="
|
||||
@@ -206,13 +246,14 @@ main() {
|
||||
print_status "Application deployment completed, proceeding with Nginx and monitoring..."
|
||||
sleep 5
|
||||
|
||||
deploy_nginx_monitoring
|
||||
deploy_static_ingress
|
||||
deploy_monitoring_only
|
||||
print_status "All services deployed, running final checks..."
|
||||
sleep 10
|
||||
|
||||
check_services
|
||||
test_connectivity
|
||||
show_connection_info
|
||||
test_connectivity_ingress
|
||||
show_connection_info_ingress
|
||||
}
|
||||
|
||||
# Check for command line options
|
||||
|
||||
Reference in New Issue
Block a user