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
This commit is contained in:
@@ -38,7 +38,7 @@ spec:
|
|||||||
protocol: TCP
|
protocol: TCP
|
||||||
livenessProbe:
|
livenessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /api/v1/health
|
path: /health
|
||||||
port: 8080
|
port: 8080
|
||||||
initialDelaySeconds: 30
|
initialDelaySeconds: 30
|
||||||
periodSeconds: 10
|
periodSeconds: 10
|
||||||
@@ -46,7 +46,7 @@ spec:
|
|||||||
failureThreshold: 3
|
failureThreshold: 3
|
||||||
readinessProbe:
|
readinessProbe:
|
||||||
httpGet:
|
httpGet:
|
||||||
path: /api/v1/health
|
path: /health
|
||||||
port: 8080
|
port: 8080
|
||||||
initialDelaySeconds: 15 # Aguarda mais tempo para inicializar
|
initialDelaySeconds: 15 # Aguarda mais tempo para inicializar
|
||||||
periodSeconds: 5
|
periodSeconds: 5
|
||||||
|
|||||||
@@ -88,11 +88,22 @@ fi
|
|||||||
|
|
||||||
# Obter URL da aplicação
|
# Obter URL da aplicação
|
||||||
echo -e "${YELLOW}🌍 Getting application URL...${NC}"
|
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
|
if [ -n "$ROUTE_URL" ]; then
|
||||||
echo -e "${GREEN}✅ Application deployed successfully!${NC}"
|
echo -e "${GREEN}✅ Application deployed successfully!${NC}"
|
||||||
echo -e "${GREEN}🌐 URL: https://$ROUTE_URL${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
|
else
|
||||||
echo -e "${YELLOW}⚠️ Route not found, checking service...${NC}"
|
echo -e "${YELLOW}⚠️ Route not found, checking service...${NC}"
|
||||||
oc get svc -n $NAMESPACE
|
oc get svc -n $NAMESPACE
|
||||||
|
|||||||
Reference in New Issue
Block a user