8000 Simplify Gateway Route Binding · Issue #594 · kubernetes-sigs/gateway-api · GitHub
[go: up one dir, main page]

Skip to content

Simplify Gateway Route Binding #594

@robscott

Description

@robscott

At our last community meeting, we talked about ways we could simplify Gateway Route binding. That was centered around a relatively lengthy doc I'd written covering a few different options. Thanks to some great feedback in that meeting and in the doc, I think we've reached an option that makes a lot of sense. I wanted to raised this as an issue just so we had a bit more visibility on this and could track progress towards v1alpha2.

Here are the key parts of this proposal:

  • Expand Gateway selection config in Routes to mirror Route selection config from Gateways.
  • Introduce a new from field in both cases with All or Selector options.
  • Empty selector does not select anything.
  • Default from to All on Gateway (bind to anything by default).
  • Default from to Selector on Routes (don't bind to anything by default, selector needs to be specified).
  • SameNamespace is default on Gateway and new Routes.

Simple Example

kind: Gateway
metadata:
  name: simple-gateway
  labels:
    gateway: xlb
spec:
  gatewayClassName: acme-lb
  listeners:
  - protocol: HTTP
    port: 80
    routes:
      kind: HTTPRoute
---
kind: HTTPRoute
metadata:
  name: simple-route
  namespace: gateway-api-example-ns2
spec:
  gateways:
    from: Selector
    selector:
      gateway: xlb
  rules:
  - matches:
    - path:
        type: Prefix
        value: /
    forwardTo:
    - serviceName: my-bar-service1
      port: 8080

Multi-Listener Example

kind: Gateway
metadata:
  name: simple-gateway
  labels:
    gateway: xlb
spec:
  gatewayClassName: acme-lb
  listeners:
  - protocol: HTTP
    port: 80
    routes:
      kind: HTTPRoute
      from: Selector
      selector:
        http-gateway: yes
  - protocol: HTTPS
    port: 443
    routes:
      kind: HTTPRoute
      from: Selector
      selector:
        https-gateway: yes
---
kind: HTTPRoute
metadata:
  name: simple-route
  namespace: gateway-api-example-ns2
  labels:
    http-gateway: yes
spec:
  gateways:
    from: Selector
    selector:
      gateway: xlb
  rules:
  - matches:
    - path:
        type: Prefix
        value: /
    forwardTo:
    - serviceName: my-bar-service1
      port: 8080
< 5C0C /div>

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0