From c81ba36b26eaa3f6f253cbdf6eac509e7e3af4a9 Mon Sep 17 00:00:00 2001 From: andersonid Date: Fri, 3 Oct 2025 06:37:35 -0300 Subject: [PATCH] fix: correct route name and health check endpoints in deployment - Fix route name mismatch: script was looking for 'resource-governance' but route is named 'resource-governance-route' - Fix health check endpoints: use /health instead of /api/v1/health for liveness/readiness probes - Add better error handling and route verification in deploy script - Add sleep delay to ensure route is ready before URL extraction - Show available routes if expected route is not found --- k8s/deployment.yaml | 4 ++-- scripts/deploy-complete.sh | 15 +++++++++++++-- 2 files changed, 15 insertions(+), 4 deletions(-) diff --git a/k8s/deployment.yaml b/k8s/deployment.yaml index 0b5e0c2..aa33a95 100644 --- a/k8s/deployment.yaml +++ b/k8s/deployment.yaml @@ -38,7 +38,7 @@ spec: protocol: TCP livenessProbe: httpGet: - path: /api/v1/health + path: /health port: 8080 initialDelaySeconds: 30 periodSeconds: 10 @@ -46,7 +46,7 @@ spec: failureThreshold: 3 readinessProbe: httpGet: - path: /api/v1/health + path: /health port: 8080 initialDelaySeconds: 15 # Aguarda mais tempo para inicializar periodSeconds: 5 diff --git a/scripts/deploy-complete.sh b/scripts/deploy-complete.sh index 144daaa..89156fa 100755 --- a/scripts/deploy-complete.sh +++ b/scripts/deploy-complete.sh @@ -88,11 +88,22 @@ fi # Obter URL da aplicação echo -e "${YELLOW}🌍 Getting application URL...${NC}" -ROUTE_URL=$(oc get route resource-governance -n $NAMESPACE -o jsonpath='{.spec.host}') + +# Aguardar um pouco para garantir que a rota esteja pronta +sleep 5 + +# Verificar se a rota existe +if oc get route resource-governance-route -n $NAMESPACE > /dev/null 2>&1; then + ROUTE_URL=$(oc get route resource-governance-route -n $NAMESPACE -o jsonpath='{.spec.host}') +else + echo -e "${YELLOW}⚠️ Route not found, checking available routes...${NC}" + oc get routes -n $NAMESPACE + ROUTE_URL="" +fi if [ -n "$ROUTE_URL" ]; then echo -e "${GREEN}✅ Application deployed successfully!${NC}" echo -e "${GREEN}🌐 URL: https://$ROUTE_URL${NC}" - echo -e "${GREEN}📊 Health check: https://$ROUTE_URL/api/v1/health${NC}" + echo -e "${GREEN}📊 Health check: https://$ROUTE_URL/health${NC}" else echo -e "${YELLOW}⚠️ Route not found, checking service...${NC}" oc get svc -n $NAMESPACE