nginxinc / nginx-gateway-fabric

NGINX Gateway Fabric provides an implementation for the Gateway API using NGINX as the data plane.
Apache License 2.0
502 stars 97 forks source link

Core API: Report proper HTTPRoute and Gateway Condition when GatewayClass is invalid or doesn't exist #307

Closed pleshakov closed 1 year ago

pleshakov commented 1 year ago

Background There is one to one mapping between NKG and GatewayClass resource.

The GatewayClass might be invalid (ex, its controllerName doesn't match NKG controller name). The GatewayClass might not even exist.

For those cases NGK doesn't generate any NGINX configuration and as a result, NGINX will not accept any traffic. However, NKG still processes Gateways and HTTPRoutes.

Requirements

When GatewayClass is invalid or it is doesn't exist, NGK must report Accepted (false) and appropriate reasons in the statuses of HTTPRoute resources and Gateway resources.

Figure out an appropriate Reason. Check the Gateway API first. If necessary, introduce NKG-specific reasons.

Acceptance Criteria

Aha! Link: https://nginx.aha.io/features/NKG-17

pleshakov commented 1 year ago

Discussed with @kate-osborn implementation approach: