hashicorp / consul

Consul is a distributed, highly available, and data center aware solution to connect and configure applications across dynamic, distributed infrastructure.
https://www.consul.io
Other
28.31k stars 4.42k forks source link

Feature Request - Implement Gateway API Service Mesh and Administration (GAMMA) Specification #18543

Open david-yu opened 1 year ago

david-yu commented 1 year ago

Feature Description

Consul currently implements Gateway API for north/south traffic. By implementing GAMMA for east/west traffic, Consul 1.19 could provide an alternative simplified UX that allows users to configure traffic using foundational xRoute APIs that have been standardized by the Gateway API community. In addition, the implementation allows us to leverage the breadth of ecosystem projects which have also standardized on the Gateway API for integrations with Service Mesh or API gateway implementations.

Prior to GAMMA, a user would need to define policies using either ServiceRouter, ServiceResolver, or ServiceSplitter and know when to use a Consul specific entry for a specific use case. Below is an example of managing east west traffic across services from web to api using L7 header matching using ServiceRouter.

apiVersion: consul.hashicorp.com/v1alpha1
kind: ServiceRouter
metadata:
 name: web
spec:
 routes:
   - match:
       http:
         header:
           - name: x-debug
             exact: '1'
     destination:
       service: api
       serviceSubset: canary
   - match:
       http:
         queryParam:
           - name: x-debug
             exact: '1'
     destination:
       service: api
       serviceSubset: canary

Now with GAMMA a user can configure the Mesh for a variety of use cases for HTTP services using the HTTPRoute API. Services using other protocols such as TCP and GRPC could also leverage the TCPRoute and GRPCRoute APIs for configuring traffic.

apiVersion: gateway.networking.k8s.io/v1beta1
kind: HTTPRoute
metadata:
  name: web
spec:
  parentRefs:
  - kind: Service
    name: web
  rules:
  - matches:
    - headers:
      - type: Exact
        name: x-debug
        value: 1
      method: GET
    backendRefs:
    - name: api
      port: 8080
  - matches:
    - queryParams:
      - type: Exact
        name: x-debug
        value: 1
      method: GET
    backendRefs:
    - name: api
      port: 8080

Use Case(s)

Service Mesh for Consul on Kubernetes

vijayraghav-io commented 1 year ago

Hi @david-yu , i am interested to work on this, can you assign to me

david-yu commented 1 year ago

Hi @vijayraghav-io This one is quite involved and requires some re-work in the Catalog Design that is currently in development for our 1.17 release. Right now we are mostly looking to gauge interest from the community prior to taking this on. We will be making sure that our Config Entry (now called Resources 1.17) model lines up with GAMMA in terms of design, but we won't be implementing or running conformance tests against GAMMA for 1.17.