Coder Social home page Coder Social logo

Comments (4)

Nadine2016 avatar Nadine2016 commented on June 25, 2024

#9194

from gloo.

sam-heilbron avatar sam-heilbron commented on June 25, 2024

Option A: Routing to the Kubernetes Service directly

This works by routing traffic from the client, through the gateway-proxy, directly to the Kubernetes Service. As @DuncanDoyle points out, this means that we are relying on the kube-proxy as opposed to our gateway-proxy for upstream load balancing.

This option is configured via the API:

routes:
- matchers:
   - prefix: /petstore
  routeAction:
    single:
      kube:
        ref:
          name: petstore
          namespace: default
        port: 8080

The ControlPlane relies on a Gloo primitive, the Upstream CR, to define upstream workloads. This is meant as a generic API to apply to upstream workloads as this may be a kubernetes service, or any other type of destination. Because of this API, we have logic to validate that upstream destinations are in fact valid. This works by performing the following steps:

  1. Convert a "destination" into the Upstream reference (name/namespace)
  2. Inspect the API Snapshot (the full set of resources that Gloo is aware of) to see if that Upstream ref exists
  3. Error if not

As a result, to allow for routing to a Kubernetes Service directly, Gloo must create an Upstream CR to represent the config (and therefore it is in the API Snapshot, and the above linked code does not return an error).
In order to generate the Upstream, Gloo must:

  1. Poll the list of Kubernetes Services (https://github.com/solo-io/gloo/blob/main/projects/gloo/pkg/upstreams/hybrid_client.go#L50)
  2. Update the internal memory to store those Upstream representations

This action has been proven to be more resource exhaustive

Option B: Routing to the Kubernetes Service via the Standard Upstream API

Instead of routing to a Kubernetes Service, you can route to the endpoints that a Kubernetes Service represents.

This is done via the Upstream API:

The ControlPlane will then execute an EDS loop (https://github.com/solo-io/gloo/blob/main/projects/gloo/pkg/plugins/kubernetes/eds.go#L88) in which the Upstreams are processed, and the ControlPlane continually resolves the available pods/endpoints to pass along to the gateway-proxy.

from gloo.

Nadine2016 avatar Nadine2016 commented on June 25, 2024

#9196

from gloo.

Nadine2016 avatar Nadine2016 commented on June 25, 2024

this is in prod https://docs.solo.io/gloo-edge/latest/guides/traffic_management/destination_types/kubernetes_services/ closing

from gloo.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.