gateway-api icon indicating copy to clipboard operation
gateway-api copied to clipboard

Define standard conformance format for a GatewayClass to communicate what it supports to operators

Open mark-church opened this issue 5 years ago • 8 comments

What would you like to be added: GatewayClasses encapsulate the capabilities that an implementation of Service APIs supports. However, for the platform operators or application operators who might deploy Gateways in a cluster may not know exactly what within the API a given GatewayClass supports. This issue proposes a standard way for all GatewayClasses to communicate to a user what it supports.

Let's say I have an acme-lb GatewayClass. The GatewayClass should be able to tell me the following:

kind: Gateway
apiVersion: networking.x-k8s.io/v1alpha1
metadata:
  name: supported
spec:
  gatewayClassName: supported
  listeners:  
  - protocol: 
      http: supported
      tcp: unsupported
      udp: unsupported
    port: supported
    routes:
      kind: 
        HTTPRoute: supported
        TCPRoute: unsupported
        UDPRoute: unsupported
      selector:
        matchLabels: supported
...
---
HTTPRoute:
  spec:
    hostnames: supported
    rules:
    - matches:
      - path:
          type: 
            prefix: supported
            exact: supported
            regularexpression: unsupported
            implementationspecific: unsupported
        headers:
          type:
            exact: supported
            implementationspecific: 
              contains: supported # Will match traffic with any single header that contains this string
              doesnotcontain: supported # Will match traffic if no headers contain this string 
...

This is a terrible example of the format but you get the idea :) Perhaps OpenAPI has some kind of capability for this.

The goals this aims to achieve:

  • Provide a standardized way for all GatewayClasses to communicate which aspects of the API they support.
  • Core fields must be supported to achieve conformance, but since extended fields can be optional it will be very useful to understand which extended fields are implemented by a given GatewayClass.
  • Custom fields (like annotations, ImplementationSpecific fields, or CRDs that can be referenced) should also be able to be communicated in some way so operators can understand how a GatewayClass has been extended with additional functionality.
  • Provide a way for the provider to give additional context to describe implementation-specific aspects of a core, extended, or custom field. The example above with contains illustrates this.

How a GatewayClass provider communicates to the operator what its capabilities are can be done in many different ways:

  • Perhaps conformance tests spits this out as a standardized output and providers can simply put this in their docs
  • Perhaps comments or fields within a GatewayClass implementation can fill out these fields. This would give the opportunity for implementors to add special comments and context regarding support for specific fields. This might be the case where a field is supported but how it functions requires more context or explanation.

cc @robscott

mark-church avatar Nov 25 '20 14:11 mark-church

/kind documentation

kundan2707 avatar Dec 01 '20 16:12 kundan2707

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale

fejta-bot avatar Mar 01 '21 16:03 fejta-bot

Stale issues rot after 30d of inactivity. Mark the issue as fresh with /remove-lifecycle rotten. Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle rotten

fejta-bot avatar Mar 31 '21 17:03 fejta-bot

/remove-lifecycle rotten

robscott avatar Mar 31 '21 17:03 robscott

I think we talked about something like this a long time ago, having this sort of information be passed in the Status of the GatewayClass, so that you can look at a GatewayClass and undestand what features will work, before you start putting Routes into Gateways. It might make sense to have that information in the Gateway status as well though.

youngnick avatar Apr 08 '21 00:04 youngnick

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale. Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community. /lifecycle stale

fejta-bot avatar Jul 07 '21 01:07 fejta-bot

/remove-lifecycle stale /lifecycle frozen

jpeach avatar Jul 07 '21 03:07 jpeach

Despite this issue being quite old, we the maintainers are still pretty convinced that we want to have this functionality in a future release. This could be particularly useful for conformance test targeting, as well as generally useful for end-users. We are marking this help wanted as we're looking for contributors with strong use cases to help champion and drive this forward.

shaneutt avatar Aug 04 '22 21:08 shaneutt

tbh this is pretty similar to some of the ideas in #1804

youngnick avatar Mar 10 '23 04:03 youngnick

Indeed, for anyone visiting this issue please consider it a duplicate of #1804 and follow up over there :+1:

shaneutt avatar Mar 10 '23 15:03 shaneutt