Why gateways run the other way
About 480 words
Everywhere else, dependsOn means the dependent opens connections to its dependency: the shop depends on its database, so the shop reaches the database. For a Resource of spec.type: gateway, the plugin turns that around: the gateway reaches the endpoints that depend on it. This page explains why.
What the catalog means by it
A team that runs its app behind a shared ingress or Gateway API gateway writes:
kind: Component
metadata:
name: shop
spec:
dependsOn: [resource:prod, resource:edge]The dependency is real: without the gateway nobody reaches the shop. It's also the natural way round to write it. The shop's team owns the shop's entity and decides which gateway exposes it; the gateway's owners don't have to list every app behind it, and a new app doesn't need a change to the gateway's entity.
The traffic, though, goes the other way. The gateway's proxy pods receive a request and open a connection to the shop's pods. The shop never connects to the gateway. A literal reading of dependsOn would allow shop to gateway, which is useless, and leave gateway to shop denied, which breaks the app.
So for a gateway the plugin reads dependsOn as is exposed through:
component:shop is exposed through resource:edgeand renders an egress from the gateway's pods to the shop's, and the matching ingress on the shop, on the shop's cilium-ports. Flows from relations shows the manifests.
Why the shop's ports
A gateway forwards to whatever port the app listens on, and that's the app's business: the shop's cilium-ports say it, so the gateway may reach the shop on those ports and no others. The gateway's own cilium-ports are for traffic into the gateway, typically from entity:world through its cilium-allow.
The gateway's own dependencies
A gateway Resource usually depends on things too: the controller that configures it, the load balancer in front of it. Those say what the gateway is made of, not what it connects to, and the plugin ignores a gateway's dependsOn for flows. If the gateway's proxies need to reach something (an external authorization service, say), use consumesApis on a Component that covers the proxies, or a rule entity.
When it's not a gateway
The reversal only applies to Resources with spec.type: gateway exactly. A Component that acts as a reverse proxy, or a Resource of another type, is read the normal way. If your gateways are modelled differently, either give them spec.type: gateway, or describe the traffic with consumesApis on the proxy (it consumes the APIs of the apps behind it) or with rule entities.
