Replace grand-central Ingress with HTTPRoute and Traefik Middlewares#837
Replace grand-central Ingress with HTTPRoute and Traefik Middlewares#837tomach wants to merge 9 commits into
Conversation
3ab31e1 to
bf3789f
Compare
bf3789f to
6946339
Compare
|
Caught some errors on dev on /auth and /health endpoints: According to the W3C and MDN web specs, the Access-Control-Allow-Origin header can only contain a single origin, the wildcard *, or null. It cannot accept a comma-separated list of multiple origins. When you pass a list, browsers reject it as an invalid value, causing the CORS block. |
juanpardo
left a comment
There was a problem hiding this comment.
Added a few comments. It looks good
| _HTTPROUTE_PLURAL = "httproutes" | ||
|
|
||
| _GC_GATEWAY_NAME: str = "traefik" | ||
| _GC_GATEWAY_NAMESPACE: str = "traefik" |
|
|
||
| if use_traefik: | ||
| custom = CustomObjectsApi(api_client) | ||
| for mw_body in ( |
There was a problem hiding this comment.
I think this code is repeated in create_grand_central_exposure at line 756
| Scale the grand-central Deployment to 0 (suspend) or 1 (start) and | ||
| manage its routing resources accordingly. | ||
|
|
||
| On suspend, the Deployment is scaled to 0 and the active routing resource |
There was a problem hiding this comment.
This would still not delete the DNS entry, right? I hope not because that way we can avoid the DNS propagation time when resuming. CC @goat-ssh
There was a problem hiding this comment.
| Record | Resource | How DNS is created |
|---|---|---|
*.aks1.eastus.azure.cratedb-dev.net → CNAME |
IngressRouteTCP (CrateDB cluster) | CNAME to the regional Traefik LB hostname |
*.gc.aks1.eastus.azure.cratedb-dev.net → A |
HTTPRoute (grand-central) | external-dns creates an A record directly from the Gateway's resolved IP |
Note: Both records resolve to the same Traefik load balancer IP: 51.8.42.241
so, yes the tenant grand central DNS is deleted on suspend.
2285ad0 to
2c867a7
Compare
2c867a7 to
b4041f1
Compare
Summary of changes
Extends the existing
exposurefield support to grand-central. Whenspec.cluster.exposure: traefik, grand-central is now exposed through the Gateway API (HTTPRoute) and three Traefik Middlewares instead of an nginxIngress. The defaultloadbalancerpath is unchanged.grand-central.pyadds builders forHTTPRoute,compress-js,buffering, andip-allowlistMiddlewares; addscreate_grand_central_exposure(routing resources only, no deployment/service) and delete helpers for both pathsexposure.py-ChangeExposureSubHandlernow also switches grand-central resources when the exposure field changesoperations.py-suspend_or_start_grand_centraldeletes routing resources on suspend and recreates them on resume, respecting the active exposure modehandle_update_allowed_cidrs.pypatches theip-allowlistMiddleware instead of the Ingress annotation whenexposure=traefikgateway.networking.k8s.io/httproutesandtraefik.io/middlewaresChecklist
CHANGES.rst