Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement per-route options in BBS #939

Closed
2 tasks
Tracked by #909
maxmoehl opened this issue Jul 17, 2024 · 2 comments
Closed
2 tasks
Tracked by #909

Implement per-route options in BBS #939

maxmoehl opened this issue Jul 17, 2024 · 2 comments

Comments

@maxmoehl
Copy link
Member

Proposed Change

In RFC0027 Generic Per-Route Features we decided to implement a new field for routes which can contain additional, custom configuration for a route. Together with this new feature we also want to implement the first property making use of it: customisable load balancing algorithms.

This new field must be implemented in BBS to allow cloud controller to forward the new field and for route-emitter to announce it via nats. The field should be opaque to BBS, for BBS it is a string which can contain arbitrary data.

Acceptance criteria

  • BBS endpoints are adjusted to accept the new field.
  • BBS stores the new field of routes.

Related links

@a18e
Copy link

a18e commented Oct 21, 2024

We investigated this and found that no changes are required in bbs for the per-route-options feature to work:

The route object is stored as a generic JSON object in bbs, presumably since bbs itself has no use for the route information. So bbs just accepts the route options (see Per-Route-Options RFC) that it receives from Cloud Controller and saves them as a string to its database.

The datatype for the route JSON in the database is text (should allow for 64KB of data) so we will not run into a limitation here when adding more route options (Validation of the fields still has to be performed in cloud controller).

We have tested this by hacking the options into Cloud Controller (see diff below) and fetching the information stored in bbs via cfdot desired-lrps.

We will now move on to adjusting route-emitter to ensure that the end-to-end scenario works (CC to Gorouter routing table).

Index: lib/cloud_controller/diego/app_recipe_builder.rb
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/lib/cloud_controller/diego/app_recipe_builder.rb b/lib/cloud_controller/diego/app_recipe_builder.rb
--- a/lib/cloud_controller/diego/app_recipe_builder.rb	
+++ b/lib/cloud_controller/diego/app_recipe_builder.rb	
@@ -156,7 +156,10 @@
             port: i['port'],
             route_service_url: i['route_service_url'],
             isolation_segment: IsolationSegmentSelector.for_space(process.space),
-            protocol: i['protocol']
+            protocol: i['protocol'],
+            options: {
+              "lb_algo": "least-connection",
+            }
           }
         end

IMO we can close this issue.

@maxmoehl
Copy link
Member Author

Thank you @a18e for the details! I'm closing this as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

No branches or pull requests

2 participants