Add automatic TLS configuration to routes

- Fix oc expose service not configuring TLS by default
- Add oc patch command to configure TLS after route creation
- Ensures routes work properly with HTTPS in all clusters
- Applied to both deploy-complete.sh and deploy-s2i.sh
This commit is contained in:
2025-10-04 11:35:39 -03:00
parent 018bdc0cc5
commit 4301023a66
2 changed files with 9 additions and 1 deletions

View File

@@ -70,6 +70,10 @@ oc apply -f k8s/service.yaml
echo -e "${YELLOW}Creating Route...${NC}"
oc expose service resource-governance-service -n $NAMESPACE --name=resource-governance-route --path=/
# Configure TLS for the route
echo -e "${YELLOW}Configuring TLS for Route...${NC}"
oc patch route resource-governance-route -n $NAMESPACE -p '{"spec":{"tls":{"termination":"edge","insecureEdgeTerminationPolicy":"Redirect"}}}'
# Wait for deployment to be ready
echo -e "${YELLOW}Waiting for deployment to be ready...${NC}"
oc rollout status deployment/resource-governance -n $NAMESPACE --timeout=300s