2020# Uses the gateway-runtime container (Router + Policy Engine combined)
2121# Build coverage images with: make build-gateway-runtime-coverage
2222
23- # NOTE: gateway-controller and gateway-runtime are duplicated in docker-compose.test.yaml — keep in sync.
23+ # NOTE: gateway-controller and gateway-runtime are duplicated in docker-compose.test.yaml
24+ # for the single-controller baseline. This Postgres compose intentionally adds
25+ # gateway-controller-runtime to exercise Postgres/EventHub replica sync.
2426
2527services :
2628 # Mock platform-api for subscription-validation IT (mimics platform-api WebSocket events)
@@ -117,6 +119,47 @@ services:
117119 networks :
118120 - it-gateway-runtime-network
119121
122+ # Runtime-facing gateway-controller replica. The integration tests continue to
123+ # send management REST calls to gateway-controller above; this controller only
124+ # serves xDS to gateway-runtime after synchronizing through Postgres/EventHub.
125+ gateway-controller-runtime :
126+ container_name : it-gateway-controller-runtime
127+ image : ghcr.io/wso2/api-platform/gateway-controller-coverage:test
128+ mem_limit : 1000m
129+ mem_reservation : 1000m
130+ cpus : 0.5
131+ command : ["-config", "/etc/gateway-controller/config.toml"]
132+ environment :
133+ - APIP_GW_CONTROLLER_STORAGE_TYPE=postgres
134+ - APIP_GW_CONTROLLER_STORAGE_POSTGRES_HOST=postgres
135+ - APIP_GW_CONTROLLER_STORAGE_POSTGRES_PORT=5432
136+ - APIP_GW_CONTROLLER_STORAGE_POSTGRES_DATABASE=gateway_test
137+ - APIP_GW_CONTROLLER_STORAGE_POSTGRES_USER=gateway
138+ - APIP_GW_CONTROLLER_STORAGE_POSTGRES_PASSWORD=gateway
139+ - APIP_GW_CONTROLLER_STORAGE_POSTGRES_SSLMODE=disable
140+ - APIP_GW_CONTROLLER_LOGGING_LEVEL=debug
141+ - GOCOVERDIR=/coverage
142+ # Used by template-functions IT to verify {{ env "..." }} resolution in spec fields
143+ - IT_TEMPLATE_PATH=/anything
144+ volumes :
145+ - controller-data-tests:/app/data
146+ - ./it-aesgcm-keys/default-aesgcm256-v1.bin:/app/data/aesgcm-keys/default-aesgcm256-v1.bin:ro
147+ - ./test-config.toml:/etc/gateway-controller/config.toml:ro
148+ - ../gateway-controller/certificates:/app/certificates
149+ - ../gateway-controller/listener-certs:/app/listener-certs:ro
150+ - ./coverage/gateway-controller:/coverage
151+ depends_on :
152+ gateway-controller :
153+ condition : service_healthy
154+ healthcheck :
155+ test : ["CMD-SHELL", "wget -q -O /dev/null http://localhost:9092/api/admin/v0.9/health || exit 1"]
156+ interval : 5s
157+ timeout : 3s
158+ retries : 10
159+ start_period : 10s
160+ networks :
161+ - it-gateway-runtime-network
162+
120163 gateway-runtime :
121164 container_name : it-gateway-runtime
122165 image : ghcr.io/wso2/api-platform/gateway-runtime-coverage:test
@@ -133,7 +176,7 @@ services:
133176 - " 9002:9002" # Admin API
134177 - " 9003:9003" # Metrics
135178 environment :
136- - GATEWAY_CONTROLLER_HOST=it-gateway-controller
179+ - GATEWAY_CONTROLLER_HOST=it-gateway-controller-runtime
137180 - LOG_LEVEL=info
138181 # Override AWS Bedrock Runtime endpoint for testing with mock service
139182 - AWS_ENDPOINT_URL_BEDROCK_RUNTIME=http://mock-aws-bedrock-guardrail:8080
@@ -142,7 +185,7 @@ services:
142185 - ./coverage/gateway-runtime:/coverage
143186 - ./test-config.toml:/etc/policy-engine/config.toml:ro
144187 depends_on :
145- gateway-controller :
188+ gateway-controller-runtime :
146189 condition : service_healthy
147190 mock-openapi :
148191 condition : service_healthy
0 commit comments