GithubHelp home page GithubHelp logo

Comments (4)

erikjoh avatar erikjoh commented on May 26, 2024 1

I think there is an opportunity here to make the setup even cleaner. Today, a full setup for a single port would look something like this:

apiVersion: v1
kind: Service
metadata:
  name: fabric-test
  namespace: fabric
  annotations:
    cloud.google.com/neg: '{"exposed_ports":{"5990":{}}}'
    controller.autoneg.dev/neg: '{"backend_services":{"5990":[{"max_rate_per_endpoint":800}]}}'
  labels:
    app: fabric-test
spec:
  selector:
    app: fabric-test
  type: ClusterIP
  clusterIP: None
  ports:
  - name: http
    port: 8080
    protocol: TCP
  - name: grpc
    port: 5990
    protocol: TCP

And it's for example not great that we need to specify the port number 5990 in three different places to make it work.
For our use-case, we usually also have multiple ports listed while we only care about one being exposed (for now at least).

One possible simplification might be if autoneg also could help with setting the cloud.google.com/neg annotation on the service.
So the flow would look something like:

  1. autoneg sees some controller.autoneg.dev annotation(s)
  2. autoneg sets the cloud.google.com/neg annotation accordingly
  3. ingress-gce sees the cloud.google.com/neg annotation and creates the NEGs and sets cloud.google.com/neg-status
  4. autoneg sees the cloud.google.com/neg-status and finally can add the NEGs to the backend service accordingly

This flow together with utilization of named ports can probably simplify things all the way down to something like this:

apiVersion: v1
kind: Service
metadata:
  name: fabric-test
  namespace: fabric
  annotations:
    controller.autoneg.dev/port-name: grpc
    controller.autoneg.dev/max-rate-per-endpoint: 800
  labels:
    app: fabric-test
spec:
  selector:
    app: fabric-test
  type: ClusterIP
  clusterIP: None
  ports:
  - name: http
    port: 8080
    protocol: TCP
  - name: grpc
    port: 5990
    protocol: TCP

And for other cases we could have options like for example:
controller.autoneg.dev/port-names: grpc,http, controller.autoneg.dev/port-names: '["grpc","http"']
controller.autoneg.dev/port: 5990, controller.autoneg.dev/ports: '["5990","8080"']

from gke-autoneg-controller.

soellman avatar soellman commented on May 26, 2024

@fdfzcq Do you and/or Fabric have thoughts here? With the new service name defaulting, I think you would need only a single annotation (controller.autoneg.dev/max-rate-per-endpoint:<number>).

from gke-autoneg-controller.

fdfzcq avatar fdfzcq commented on May 26, 2024

@soellman Sorry I totally missed this question 😅 We will discuss in the team and get back to you!

from gke-autoneg-controller.

soellman avatar soellman commented on May 26, 2024

Erik I think that's a great idea! Users can still manually set the cloud.google.com/neg and controller.autoneg.dev/neg annotations as they like.

from gke-autoneg-controller.

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.