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

HTTPRoute with multiple parentrefs not creating listener #661

Open
michal-sa opened this issue Aug 14, 2024 · 1 comment
Open

HTTPRoute with multiple parentrefs not creating listener #661

michal-sa opened this issue Aug 14, 2024 · 1 comment
Labels
bug Something isn't working

Comments

@michal-sa
Copy link

While trying to create a HTTPRoute containing two parentRefs where one is a gatewayClassName: amazon-vpc-lattice Gateway resource and the other a gateway with another class it doesn't seem like the listeners are created correctly for the lattice service.

Not working manifest:

apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
  name: test-service
  namespace: my-namespace
spec:
  parentRefs:
     - name: lattice-gateway
       namespace: gateway-controller
       sectionName: https
     - name: gateway
       namespace: another-namespace
  rules:
      - backendRefs:
        - name: test-service
          kind: Service
          namespace: my-namespace
          port: 8080

Debug controller logs:


{"level":"debug","ts":"2024-08-14T12:19:54.264Z","logger":"controller.route","caller":"gateway/model_build_listener.go:91","msg":"Ignore parentref of different gateway gateway-%!s(*v1.Namespace=0xc0013ad310)"}
{"level":"debug","ts":"2024-08-14T12:19:54.264Z","logger":"controller.route","caller":"gateway/model_build_lattice_service.go:84","msg":"Building rules for 1 listeners"}
{"level":"debug","ts":"2024-08-14T12:19:54.264Z","logger":"controller.route","caller":"gateway/model_build_rule.go:35","msg":"Processing 1 rules"}
{"level":"debug","ts":"2024-08-14T12:19:54.264Z","logger":"controller.route","caller":"gateway/model_build_rule.go:47","msg":"Processing rule match"}
{"level":"debug","ts":"2024-08-14T12:19:54.264Z","logger":"controller.route","caller":"gateway/model_build_rule.go:109","msg":"Examining pathmatch type PathPrefix value / for for httproute test-service-my-namespace "}
{"level":"debug","ts":"2024-08-14T12:19:54.264Z","logger":"controller.route","caller":"gateway/model_build_rule.go:119","msg":"Using PathMatchPathPrefix for httproute test-service-my-namespace "}
{"level":"debug","ts":"2024-08-14T12:19:54.264Z","logger":"controller.route","caller":"gateway/model_build_rule.go:226","msg":"Processing Service backendRef test-my-namespace"}
{"level":"debug","ts":"2024-08-14T12:19:54.264Z","logger":"controller.route","caller":"gateway/model_build_targetgroup.go:298","msg":"buildTargetGroupSpec, kind Service"}
{"level":"debug","ts":"2024-08-14T12:19:54.264Z","logger":"controller.route","caller":"gateway/model_build_targetgroup.go:264","msg":"Added target group for backendRef test to the stack id-a7af5abbe84d4edbcadf435b726e63cb5c6917cb7bf5d9da9298ac03d9a7b701"}
{"level":"debug","ts":"2024-08-14T12:19:54.264Z","logger":"controller.route","caller":"gateway/model_build_targets.go:89","msg":"Processing targets for service test-my-namespace"}
...
...
{"level":"debug","ts":"2024-08-14T12:19:54.355Z","logger":"controller.route","caller":"lattice/target_group_manager.go:121","msg":"HealthCheck is empty. Resetting to default settings"}
{"level":"debug","ts":"2024-08-14T12:19:54.355Z","logger":"controller.route","caller":"lattice/targets_manager.go:62","msg":"Creating targets for target group tg-02bfdf3549201a724"}
...
{"level":"debug","ts":"2024-08-14T12:19:54.759Z","logger":"controller.route","caller":"lattice/targets_manager.go:128","msg":"Successfully registered 2 targets from VPC Lattice Target Group tg-02bfdf3549201a724 for chunk 1/1"}
{"level":"debug","ts":"2024-08-14T12:19:54.759Z","logger":"controller.route","caller":"lattice/service_synthesizer.go:44","msg":"Synthesizing service: test-service-my-namespace"}
{"level":"debug","ts":"2024-08-14T12:19:54.806Z","logger":"cloud","caller":"aws/cloud.go:68","msg":"response","serviceName":"VPC Lattice","operation":"ListServices","params":"{\n\n}"}
...
{"level":"debug","ts":"2024-08-14T12:19:54.905Z","logger":"cloud","caller":"aws/cloud.go:68","msg":"response","serviceName":"VPC Lattice","operation":"ListServiceNetworks","params":"{\n\n}"}
{"level":"info","ts":"2024-08-14T12:19:54.905Z","logger":"controller.route","caller":"controllers/route_controller.go:156","msg":"reconcile error","name":"test-service","message":"error during service synthesis failed ServiceManager.Upsert test-service-my-namespace due to not found, Service network gateway"}

After removing the gateway parentRef the listerners are created successfully.

A workaround is to have two HTTPRoutes for the different gateways, but that's not optimal.

@zijun726911
Copy link
Contributor

While trying to create a HTTPRoute containing two parentRefs where one is a gatewayClassName: amazon-vpc-lattice Gateway resource and the other a gateway with another class it doesn't seem like the listeners are created correctly for the lattice service.

From my first glance, it's a controller bug, we will take a deeper look and fix it.

@zijun726911 zijun726911 added the bug Something isn't working label Aug 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants