Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support zero hostnames in HTTPRoute #606

Closed
pleshakov opened this issue May 3, 2023 · 0 comments · Fixed by #650
Closed

Support zero hostnames in HTTPRoute #606

pleshakov opened this issue May 3, 2023 · 0 comments · Fixed by #650
Assignees
Labels
area/httproute/core Relates to all Core features of HTTPRoute bug Something isn't working conformance Relates to passing Gateway API conformance tests refined Requirements are refined and the issue is ready to be implemented.
Milestone

Comments

@pleshakov
Copy link
Contributor

pleshakov commented May 3, 2023

Describe the bug
NGINX Kubernetes Gateway doesn't try to attach to a listener if an HTTPRoute has 0 hostnames.

To Reproduce
Steps to reproduce the behavior:

Gateway -- https://github.com/nginxinc/nginx-kubernetes-gateway/blob/f74c06ded5c3d647b0909fe542f3e70dbc96774c/examples/cafe-example/gateway.yaml

HTTPRoute:

apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
  name: coffee
spec:
  parentRefs:
  - name: gateway
    sectionName: http
  rules:
  - matches:
    - path:
        type: PathPrefix
        value: /coffee
    backendRefs:
    - name: coffee
      port: 80

In the status of the HTTPRoute, NKG reports:

Status:
  Parents:
    Conditions:
      Last Transition Time:  2023-05-03T15:55:08Z
      Message:               Listener hostname does not match the HTTPRoute hostnames
      Observed Generation:   1
      Reason:                NoMatchingListenerHostname
      Status:                False
      Type:                  Accepted
    Controller Name:         k8s-gateway.nginx.org/nginx-gateway-controller
    Parent Ref:
      Group:         gateway.networking.k8s.io
      Kind:          Gateway
      Name:          gateway
      Namespace:     default
      Section Name:  http

Expected behavior

  • HTTPRoute attaches to a listener
  • Traffic (in this example) - curl <any-host>/coffee routes to coffee service

Additional context

Conformance tests often don't include hostnames in HTTPRoutes. Example -- https://github.com/kubernetes-sigs/gateway-api/blob/v0.6.2/conformance/tests/httproute-matching.yaml

@pleshakov pleshakov added area/httproute/core Relates to all Core features of HTTPRoute refined Requirements are refined and the issue is ready to be implemented. bug Something isn't working labels May 3, 2023
@pleshakov pleshakov added this to the v0.4.0 milestone May 3, 2023
@pleshakov pleshakov added the conformance Relates to passing Gateway API conformance tests label May 10, 2023
@sjberman sjberman self-assigned this May 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/httproute/core Relates to all Core features of HTTPRoute bug Something isn't working conformance Relates to passing Gateway API conformance tests refined Requirements are refined and the issue is ready to be implemented.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants