From 7922fdaa52301be62aec8ad6c21654616aa917fb Mon Sep 17 00:00:00 2001 From: Daria <66593181+Dariquest@users.noreply.github.com> Date: Fri, 31 Jan 2025 14:31:14 +0100 Subject: [PATCH 01/22] Per-route options via CF cli --- custom-per-route-options.html.md.erb | 27 +++++++++++++++++++++++++-- 1 file changed, 25 insertions(+), 2 deletions(-) diff --git a/custom-per-route-options.html.md.erb b/custom-per-route-options.html.md.erb index 7c24e073..0e6af0eb 100644 --- a/custom-per-route-options.html.md.erb +++ b/custom-per-route-options.html.md.erb @@ -47,7 +47,15 @@ To configure per-route load balancing for an application that has not yet been p cf push -f manifest.yml ``` -1. To confirm the setting, query the `routes` API endpoint for the app's route: +1. To verify the setting, one can query the route via the cli route command: + ``` + cf route MY-APP.EXAMPLE.COM + ``` +The response lists the chosen `loadbalancing` algorithm option: + ``` + options: { loadbalancing: least-connections } + ``` +Alternatively, one can query the `routes` API endpoint for the app's route: ``` cf curl /v3/routes/?hosts=MY-APP @@ -64,9 +72,24 @@ To configure per-route load balancing for an application that has not yet been p ### Change Load Balancing of an Existing App -To change the per-route `loadbalancing` setting of an app that has already been pushed, `cf curl` the `/v3/routes` API. +To change the per-route `loadbalancing` setting of an app that has already been pushed, there is cli command update-route. For example, to change an app route's algorithm from `least-connections` to `round-robin`: +1. Execute an update-route command + ``` + cf update-route MY-APP.EXAMPLE.COM --option=loadbalancing=round-robin + ``` +1. To verify the setting, one can query the route via the cli route command: + ``` + cf route MY-APP.EXAMPLE.COM + ``` + +The response lists the changed `loadbalancing` algorithm option: + ``` + options: { loadbalancing: round-robin } + ``` + +Alternatively, it is also possible to `cf curl` the `/v3/routes` API. 1. Execute a `PATCH` request to the targeted API endpoint: From d8dba2512b440ac28355d5999cad4b7dbd7e3665 Mon Sep 17 00:00:00 2001 From: Daria <66593181+Dariquest@users.noreply.github.com> Date: Fri, 31 Jan 2025 14:35:17 +0100 Subject: [PATCH 02/22] Update custom-per-route-options.html.md.erb --- custom-per-route-options.html.md.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom-per-route-options.html.md.erb b/custom-per-route-options.html.md.erb index 0e6af0eb..516c0200 100644 --- a/custom-per-route-options.html.md.erb +++ b/custom-per-route-options.html.md.erb @@ -47,7 +47,7 @@ To configure per-route load balancing for an application that has not yet been p cf push -f manifest.yml ``` -1. To verify the setting, one can query the route via the cli route command: +2. To verify the setting, one can query the route via the cli route command: ``` cf route MY-APP.EXAMPLE.COM ``` @@ -79,7 +79,7 @@ For example, to change an app route's algorithm from `least-connections` to `rou ``` cf update-route MY-APP.EXAMPLE.COM --option=loadbalancing=round-robin ``` -1. To verify the setting, one can query the route via the cli route command: +2. To verify the setting, one can query the route via the cli route command: ``` cf route MY-APP.EXAMPLE.COM ``` @@ -104,7 +104,7 @@ Alternatively, it is also possible to `cf curl` the `/v3/routes` API. Where `GUID` is the unique identifier for the route. -1. To confirm the setting, query the `routes` API endpoint for the route: +2. To confirm the setting, query the `routes` API endpoint for the route: ``` cf curl /v3/routes/GUID From 026a39ddc17d585e9d262eba726a0b45aed9ad40 Mon Sep 17 00:00:00 2001 From: Daria <66593181+Dariquest@users.noreply.github.com> Date: Fri, 31 Jan 2025 14:42:40 +0100 Subject: [PATCH 03/22] Update custom-per-route-options.html.md.erb --- custom-per-route-options.html.md.erb | 39 ++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) diff --git a/custom-per-route-options.html.md.erb b/custom-per-route-options.html.md.erb index 516c0200..2ae759d5 100644 --- a/custom-per-route-options.html.md.erb +++ b/custom-per-route-options.html.md.erb @@ -117,3 +117,42 @@ Alternatively, it is also possible to `cf curl` the `/v3/routes` API. "loadbalancing": "round-robin" } ``` + +### Creating a Route with a specified Load Balancing Algorithm +To create a route with the per-route `loadbalancing` option, you can use the cli command `create-route`. +For example: + +1. Execute a create-route command + ``` + cf create-route MY-APP.EXAMPLE.COM --option=loadbalancing=round-robin + ``` +2. To verify the setting, one can query the route via the cli route command: + ``` + cf route MY-APP.EXAMPLE.COM + ``` + +The response lists the changed `loadbalancing` algorithm option: + ``` + options: { loadbalancing: round-robin } + ``` + +### Mapping a New Route to an Existing App with a specified Load Balancing Algorithm +To map a new route with the per-route `loadbalancing` option, you can use the cli command `map-route`. +If the route does not exist, it will be created with the specified load-balancing option. +If the route does exist, the cli command `update-route` should be used as described before. + +For example: + +1. Execute a map-route command + ``` + cf map-route MY-APP MY-APP.EXAMPLE.COM --option=loadbalancing=round-robin + ``` +2. To verify the setting, one can query the route via the cli route command: + ``` + cf route MY-APP.EXAMPLE.COM + ``` + +The response lists the changed `loadbalancing` algorithm option: + ``` + options: { loadbalancing: round-robin } + ``` From b1f33a5e57f10eb259c4c2c2d63295b4d9051a55 Mon Sep 17 00:00:00 2001 From: Daria <66593181+Dariquest@users.noreply.github.com> Date: Tue, 4 Feb 2025 14:16:06 +0100 Subject: [PATCH 04/22] Rename least-connections --- custom-per-route-options.html.md.erb | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/custom-per-route-options.html.md.erb b/custom-per-route-options.html.md.erb index 041cfb99..dc1c0248 100644 --- a/custom-per-route-options.html.md.erb +++ b/custom-per-route-options.html.md.erb @@ -11,7 +11,7 @@ This greater granularity lets developers tailor optimal routing behavior for app Gorouter supports the following per-route option, described in the section below: - `loadbalancing`: Configures the load balancing algorithm used by Gorouter for this particular route. <%= vars.per_route_lb_version %> - - Settings: `round-robin`, `least-connections`. + - Settings: `round-robin`, `least-connection`. ## loadbalancing: Configure Gorouter's Load Balancing Algorithm @@ -22,14 +22,14 @@ The per-route option `loadbalancing` allows configuring the load balancing algor This option supports two settings for load balancing: - `round-robin` distributes the load evenly across all available backends -- `least-connections` directs traffic to the backend with the fewest active connections at any given time, optimizing resource utilization +- `least-connection` directs traffic to the backend with the fewest active connections at any given time, optimizing resource utilization ### Configure Load Balancing in an App Manifest To configure per-route load balancing for an application that has not yet been pushed: -1. In the application manifest, include a `route` definition with an `options: loadbalancing` attribute set to `round-robin` or `least-connections`. For example: +1. In the application manifest, include a `route` definition with an `options: loadbalancing` attribute set to `round-robin` or `least-connection`. For example: ```yaml --- @@ -38,7 +38,7 @@ To configure per-route load balancing for an application that has not yet been p routes: - route: MY-APP.EXAMPLE.COM options: - loadbalancing: least-connections + loadbalancing: least-connection ``` Where `MY-APP` is the name of your app and `MY-APP.EXAMPLE.COM` is the route you want to map to your app. @@ -55,7 +55,7 @@ To configure per-route load balancing for an application that has not yet been p ``` The response lists the chosen `loadbalancing` algorithm option: ``` - options: { loadbalancing: least-connections } + options: { loadbalancing: least-connection } ``` Alternatively, one can query the `routes` API endpoint for the app's route: @@ -68,14 +68,14 @@ Alternatively, one can query the `routes` API endpoint for the app's route: ``` "options": { - "loadbalancing": "least-connections" + "loadbalancing": "least-connection" } ``` ### Change Load Balancing of an Existing App To change the per-route `loadbalancing` setting of an app that has already been pushed, there is cli command update-route. -For example, to change an app route's algorithm from `least-connections` to `round-robin`: +For example, to change an app route's algorithm from `least-connection` to `round-robin`: 1. Execute an update-route command ``` From 7b24f4476410f3e8a038192b8cf8205ef39fdb71 Mon Sep 17 00:00:00 2001 From: Anita Flegg Date: Tue, 4 Feb 2025 06:07:36 -0800 Subject: [PATCH 05/22] Fix indents + wording consistency (with doc set) changed "one can" to "you can" added colons to procedure steps changed "execute" to "run" removed "via" (Latinisms are not used in CF doc set) --- custom-per-route-options.html.md.erb | 38 +++++++++++++++------------- 1 file changed, 20 insertions(+), 18 deletions(-) diff --git a/custom-per-route-options.html.md.erb b/custom-per-route-options.html.md.erb index dc1c0248..a10c36a1 100644 --- a/custom-per-route-options.html.md.erb +++ b/custom-per-route-options.html.md.erb @@ -3,7 +3,7 @@ title: Configuring per-route options owner: CF for VMs Networking --- -By default, communication between Gorouter and backends is configured via general settings at the platform level. +By default, communication between Gorouter and backends is configured through the general settings at the platform level. This topic describes how to specify per-route Gorouter options scoped at the application level. This greater granularity lets developers tailor optimal routing behavior for applications' unique load profiles or other requirements. @@ -49,15 +49,15 @@ To configure per-route load balancing for an application that has not yet been p cf push -f manifest.yml ``` -2. To verify the setting, one can query the route via the cli route command: +2. To verify the setting, you can query the route using the cli route command: ``` cf route MY-APP.EXAMPLE.COM ``` -The response lists the chosen `loadbalancing` algorithm option: + The response lists the chosen `loadbalancing` algorithm option: ``` options: { loadbalancing: least-connection } ``` -Alternatively, one can query the `routes` API endpoint for the app's route: + Alternatively, you can query the `routes` API endpoint for the app's route: ``` cf curl /v3/routes/?hosts=MY-APP @@ -74,26 +74,25 @@ Alternatively, one can query the `routes` API endpoint for the app's route: ### Change Load Balancing of an Existing App -To change the per-route `loadbalancing` setting of an app that has already been pushed, there is cli command update-route. +To change the per-route `loadbalancing` setting of an app that has already been pushed, you can use the cli command, `update-route`. For example, to change an app route's algorithm from `least-connection` to `round-robin`: -1. Execute an update-route command +1. Run the update-route command: ``` cf update-route MY-APP.EXAMPLE.COM --option=loadbalancing=round-robin ``` -2. To verify the setting, one can query the route via the cli route command: +2. To verify the setting, you can query the route using the cli route command: ``` cf route MY-APP.EXAMPLE.COM ``` -The response lists the changed `loadbalancing` algorithm option: + The response lists the changed `loadbalancing` algorithm option: ``` options: { loadbalancing: round-robin } ``` -Alternatively, it is also possible to `cf curl` the `/v3/routes` API. -1. Execute a `PATCH` request to the targeted API endpoint: - + Alternatively, it is also possible to `cf curl` the `/v3/routes` API. +1. Run the `PATCH` request to the targeted API endpoint: ``` cf curl /v3/routes/GUID -X PATCH -H "Content-type: application/json" \ @@ -112,7 +111,9 @@ Alternatively, it is also possible to `cf curl` the `/v3/routes` API. cf curl /v3/routes/GUID ``` - Where `GUID` is the unique identifier for the route. The response lists the new `round-robin` setting: + Where `GUID` is the unique identifier for the route. + + The response lists the new `round-robin` setting: ``` "options": { @@ -124,37 +125,38 @@ Alternatively, it is also possible to `cf curl` the `/v3/routes` API. To create a route with the per-route `loadbalancing` option, you can use the cli command `create-route`. For example: -1. Execute a create-route command +1. Run the create-route command: ``` cf create-route MY-APP.EXAMPLE.COM --option=loadbalancing=round-robin ``` -2. To verify the setting, one can query the route via the cli route command: +2. To verify the setting, you can query the route using the cli route command: ``` cf route MY-APP.EXAMPLE.COM ``` -The response lists the changed `loadbalancing` algorithm option: + The response lists the changed `loadbalancing` algorithm option: ``` options: { loadbalancing: round-robin } ``` ### Mapping a New Route to an Existing App with a specified Load Balancing Algorithm + To map a new route with the per-route `loadbalancing` option, you can use the cli command `map-route`. If the route does not exist, it will be created with the specified load-balancing option. If the route does exist, the cli command `update-route` should be used as described before. For example: -1. Execute a map-route command +1. Run a map-route command: ``` cf map-route MY-APP MY-APP.EXAMPLE.COM --option=loadbalancing=round-robin ``` -2. To verify the setting, one can query the route via the cli route command: +2. To verify the setting, you can query the route using the cli route command: ``` cf route MY-APP.EXAMPLE.COM ``` -The response lists the changed `loadbalancing` algorithm option: + The response lists the changed `loadbalancing` algorithm option: ``` options: { loadbalancing: round-robin } ``` From ea118bc2a6e0ecb1225d888504060ec9b5ec149f Mon Sep 17 00:00:00 2001 From: Daria <66593181+Dariquest@users.noreply.github.com> Date: Wed, 5 Feb 2025 10:44:53 +0100 Subject: [PATCH 06/22] Update custom-per-route-options.html.md.erb Co-authored-by: Clemens Hoffmann --- custom-per-route-options.html.md.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom-per-route-options.html.md.erb b/custom-per-route-options.html.md.erb index 0c69d2e3..b072cea7 100644 --- a/custom-per-route-options.html.md.erb +++ b/custom-per-route-options.html.md.erb @@ -51,7 +51,7 @@ To configure per-route load balancing for an application that has not yet been p 2. To verify the setting, you can query the route using the cli route command: ``` - cf route MY-APP.EXAMPLE.COM + cf route EXAMPLE.COM --hostname MY-APP ``` The response lists the chosen `loadbalancing` algorithm option: ``` From 6abfc0393776384fefba2602993fe5d626de4759 Mon Sep 17 00:00:00 2001 From: Daria <66593181+Dariquest@users.noreply.github.com> Date: Wed, 5 Feb 2025 10:45:16 +0100 Subject: [PATCH 07/22] Update custom-per-route-options.html.md.erb Co-authored-by: Clemens Hoffmann --- custom-per-route-options.html.md.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom-per-route-options.html.md.erb b/custom-per-route-options.html.md.erb index b072cea7..f66ea127 100644 --- a/custom-per-route-options.html.md.erb +++ b/custom-per-route-options.html.md.erb @@ -55,7 +55,7 @@ To configure per-route load balancing for an application that has not yet been p ``` The response lists the chosen `loadbalancing` algorithm option: ``` - options: { loadbalancing: least-connection } + options: {loadbalancing=least-connection} ``` Alternatively, you can query the `routes` API endpoint for the app's route: From bbfe4782cd289e35b7595518ddcffb293160d40f Mon Sep 17 00:00:00 2001 From: Daria <66593181+Dariquest@users.noreply.github.com> Date: Wed, 5 Feb 2025 10:45:29 +0100 Subject: [PATCH 08/22] Update custom-per-route-options.html.md.erb Co-authored-by: Clemens Hoffmann --- custom-per-route-options.html.md.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom-per-route-options.html.md.erb b/custom-per-route-options.html.md.erb index f66ea127..f775dd9a 100644 --- a/custom-per-route-options.html.md.erb +++ b/custom-per-route-options.html.md.erb @@ -49,7 +49,7 @@ To configure per-route load balancing for an application that has not yet been p cf push -f manifest.yml ``` -2. To verify the setting, you can query the route using the cli route command: +2. To verify the option, you can query the route using the `route` command: ``` cf route EXAMPLE.COM --hostname MY-APP ``` From 516dcdb6266da46b3b8437dde5589b24208ef101 Mon Sep 17 00:00:00 2001 From: Daria <66593181+Dariquest@users.noreply.github.com> Date: Wed, 5 Feb 2025 10:46:58 +0100 Subject: [PATCH 09/22] Update custom-per-route-options.html.md.erb --- custom-per-route-options.html.md.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom-per-route-options.html.md.erb b/custom-per-route-options.html.md.erb index f775dd9a..0264a111 100644 --- a/custom-per-route-options.html.md.erb +++ b/custom-per-route-options.html.md.erb @@ -74,7 +74,7 @@ To configure per-route load balancing for an application that has not yet been p ### Change Load Balancing of an Existing App -To change the per-route `loadbalancing` setting of an app that has already been pushed, you can use the cli command, `update-route`. +To change the per-route `loadbalancing` option of an app that has already been pushed, you can use the cli command, `update-route`. For example, to change an app route's algorithm from `least-connection` to `round-robin`: From 41954bc068d5def472c2b2de617cb777b8df72f2 Mon Sep 17 00:00:00 2001 From: Daria <66593181+Dariquest@users.noreply.github.com> Date: Wed, 5 Feb 2025 13:56:31 +0100 Subject: [PATCH 10/22] Update custom-per-route-options.html.md.erb --- custom-per-route-options.html.md.erb | 47 +++++++++++++--------------- 1 file changed, 22 insertions(+), 25 deletions(-) diff --git a/custom-per-route-options.html.md.erb b/custom-per-route-options.html.md.erb index 0264a111..8d44984b 100644 --- a/custom-per-route-options.html.md.erb +++ b/custom-per-route-options.html.md.erb @@ -49,10 +49,8 @@ To configure per-route load balancing for an application that has not yet been p cf push -f manifest.yml ``` -2. To verify the option, you can query the route using the `route` command: - ``` - cf route EXAMPLE.COM --hostname MY-APP - ``` +2. To verify the option value, you can query the route using the cli route command `route` (see Chapter `Retrieve Route Options`). + The response lists the chosen `loadbalancing` algorithm option: ``` options: {loadbalancing=least-connection} @@ -65,16 +63,13 @@ To configure per-route load balancing for an application that has not yet been p Where `MY-APP` is the host attribute of the route. The response lists the chosen `loadbalancing` algorithm setting: - ``` - "options": { - "loadbalancing": "least-connection" - } + "options": {"loadbalancing": "least-connection"} ``` ### Change Load Balancing of an Existing App -To change the per-route `loadbalancing` option of an app that has already been pushed, you can use the cli command, `update-route`. +To change the per-route `loadbalancing` option of an existing route, you can use the cli command, `update-route`. For example, to change an app route's algorithm from `least-connection` to `round-robin`: @@ -82,14 +77,11 @@ For example, to change an app route's algorithm from `least-connection` to `roun ``` cf update-route MY-APP.EXAMPLE.COM --option=loadbalancing=round-robin ``` -2. To verify the setting, you can query the route using the cli route command: - ``` - cf route MY-APP.EXAMPLE.COM - ``` +2. To verify the option value, you can query the route using the cli route command `route` (see Chapter `Retrieve Route Options`). The response lists the changed `loadbalancing` algorithm option: ``` - options: { loadbalancing: round-robin } + options: {loadbalancing: round-robin} ``` Alternatively, it is also possible to `cf curl` the `/v3/routes` API. @@ -130,10 +122,7 @@ For example: ``` cf create-route MY-APP.EXAMPLE.COM --option=loadbalancing=round-robin ``` -2. To verify the setting, you can query the route using the cli route command: - ``` - cf route MY-APP.EXAMPLE.COM - ``` +2. To verify the option value, you can query the route using the cli route command `route` (see Chapter `Retrieve Route Options`). The response lists the changed `loadbalancing` algorithm option: ``` @@ -142,9 +131,9 @@ For example: ### Mapping a New Route to an Existing App with a specified Load Balancing Algorithm -To map a new route with the per-route `loadbalancing` option, you can use the cli command `map-route`. -If the route does not exist, it will be created with the specified load-balancing option. -If the route does exist, the cli command `update-route` should be used as described before. +To create and map a new route to an existing application with the per-route `loadbalancing` option, you can use the cli command `map-route`. +Note: The command `map-route` supports the `--option` flag only for new routes. +To update an existing route, the command `update-route` must be used as described before. For example: @@ -152,12 +141,20 @@ For example: ``` cf map-route MY-APP MY-APP.EXAMPLE.COM --option=loadbalancing=round-robin ``` -2. To verify the setting, you can query the route using the cli route command: +2. To verify the option value, you can query the route using the cli route command `route` (see Chapter `Retrieve Route Options`). + + The response lists the changed `loadbalancing` algorithm option: ``` - cf route MY-APP.EXAMPLE.COM + options: { loadbalancing: round-robin } ``` - The response lists the changed `loadbalancing` algorithm option: +### Retrieve Route Options + +To verify route options, you can query the route using the `route` command: ``` - options: { loadbalancing: round-robin } + cf route EXAMPLE.COM --hostname MY-APP + ``` + The response lists the chosen `loadbalancing` algorithm option, e.g. `loadbalancing`: + ``` + options: {loadbalancing=least-connection} ``` From a5959714ddcec46104bbdf6ac5effd1289a61728 Mon Sep 17 00:00:00 2001 From: Daria <66593181+Dariquest@users.noreply.github.com> Date: Wed, 5 Feb 2025 13:58:32 +0100 Subject: [PATCH 11/22] Update custom-per-route-options.html.md.erb --- custom-per-route-options.html.md.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom-per-route-options.html.md.erb b/custom-per-route-options.html.md.erb index 8d44984b..724399ed 100644 --- a/custom-per-route-options.html.md.erb +++ b/custom-per-route-options.html.md.erb @@ -139,7 +139,7 @@ For example: 1. Run a map-route command: ``` - cf map-route MY-APP MY-APP.EXAMPLE.COM --option=loadbalancing=round-robin + cf map-route MY-APP EXAMPLE.COM --hostname MY-HOST --option loadbalancing=round-robin ``` 2. To verify the option value, you can query the route using the cli route command `route` (see Chapter `Retrieve Route Options`). From b593ca837d24a12f6db42dda0fd35766cd029245 Mon Sep 17 00:00:00 2001 From: Anita Flegg Date: Wed, 5 Feb 2025 05:13:42 -0800 Subject: [PATCH 12/22] Change Note to use note class --- custom-per-route-options.html.md.erb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/custom-per-route-options.html.md.erb b/custom-per-route-options.html.md.erb index 724399ed..96bd559c 100644 --- a/custom-per-route-options.html.md.erb +++ b/custom-per-route-options.html.md.erb @@ -132,8 +132,10 @@ For example: ### Mapping a New Route to an Existing App with a specified Load Balancing Algorithm To create and map a new route to an existing application with the per-route `loadbalancing` option, you can use the cli command `map-route`. -Note: The command `map-route` supports the `--option` flag only for new routes. -To update an existing route, the command `update-route` must be used as described before. + +

+The command map-route supports the --option flag only for new routes. +To update an existing route, the command update-route must be used as described before.

For example: From 32d49f1c8ae3d7583a55400fc36e3caf0ee03ff6 Mon Sep 17 00:00:00 2001 From: Daria <66593181+Dariquest@users.noreply.github.com> Date: Wed, 5 Feb 2025 14:26:25 +0100 Subject: [PATCH 13/22] Rename host MY-APP to MY-HOST --- custom-per-route-options.html.md.erb | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/custom-per-route-options.html.md.erb b/custom-per-route-options.html.md.erb index 96bd559c..9e077e48 100644 --- a/custom-per-route-options.html.md.erb +++ b/custom-per-route-options.html.md.erb @@ -36,7 +36,7 @@ To configure per-route load balancing for an application that has not yet been p applications: - name: MY-APP routes: - - route: MY-APP.EXAMPLE.COM + - route: MY-HOST.EXAMPLE.COM options: loadbalancing: least-connection ``` @@ -58,10 +58,10 @@ To configure per-route load balancing for an application that has not yet been p Alternatively, you can query the `routes` API endpoint for the app's route: ``` - cf curl /v3/routes/?hosts=MY-APP + cf curl /v3/routes/?hosts=MY-HOST ``` - Where `MY-APP` is the host attribute of the route. The response lists the chosen `loadbalancing` algorithm setting: + Where `MY-HOST` is the host attribute of the route. The response lists the chosen `loadbalancing` algorithm setting: ``` "options": {"loadbalancing": "least-connection"} @@ -75,7 +75,7 @@ For example, to change an app route's algorithm from `least-connection` to `roun 1. Run the update-route command: ``` - cf update-route MY-APP.EXAMPLE.COM --option=loadbalancing=round-robin + cf update-route EXAMPLE.COM --host MY-HOST--option=loadbalancing=round-robin ``` 2. To verify the option value, you can query the route using the cli route command `route` (see Chapter `Retrieve Route Options`). @@ -120,7 +120,7 @@ For example: 1. Run the create-route command: ``` - cf create-route MY-APP.EXAMPLE.COM --option=loadbalancing=round-robin + cf create-route EXAMPLE.COM --host MY-HOST --option=loadbalancing=round-robin ``` 2. To verify the option value, you can query the route using the cli route command `route` (see Chapter `Retrieve Route Options`). @@ -154,7 +154,7 @@ For example: To verify route options, you can query the route using the `route` command: ``` - cf route EXAMPLE.COM --hostname MY-APP + cf route EXAMPLE.COM --hostname MY-HOST ``` The response lists the chosen `loadbalancing` algorithm option, e.g. `loadbalancing`: ``` From e57290dd91bbe5cf253457176c78659c837985bd Mon Sep 17 00:00:00 2001 From: Daria <66593181+Dariquest@users.noreply.github.com> Date: Wed, 5 Feb 2025 14:28:50 +0100 Subject: [PATCH 14/22] Correct the chapter vars --- custom-per-route-options.html.md.erb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/custom-per-route-options.html.md.erb b/custom-per-route-options.html.md.erb index 9e077e48..8cce2916 100644 --- a/custom-per-route-options.html.md.erb +++ b/custom-per-route-options.html.md.erb @@ -75,7 +75,7 @@ For example, to change an app route's algorithm from `least-connection` to `roun 1. Run the update-route command: ``` - cf update-route EXAMPLE.COM --host MY-HOST--option=loadbalancing=round-robin + cf update-route EXAMPLE.COM --host MY-HOST --option=loadbalancing=round-robin ``` 2. To verify the option value, you can query the route using the cli route command `route` (see Chapter `Retrieve Route Options`). @@ -114,7 +114,7 @@ For example, to change an app route's algorithm from `least-connection` to `roun } ``` -### Creating a Route with a specified Load Balancing Algorithm +### Creating a Route with a specified Load Balancing Algorithm To create a route with the per-route `loadbalancing` option, you can use the cli command `create-route`. For example: From 4226c08d7547b953e4cfb4e23e6349781cc21552 Mon Sep 17 00:00:00 2001 From: Daria <66593181+Dariquest@users.noreply.github.com> Date: Wed, 5 Feb 2025 14:41:06 +0100 Subject: [PATCH 15/22] Unification --- custom-per-route-options.html.md.erb | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/custom-per-route-options.html.md.erb b/custom-per-route-options.html.md.erb index 8cce2916..d9314a8c 100644 --- a/custom-per-route-options.html.md.erb +++ b/custom-per-route-options.html.md.erb @@ -41,7 +41,7 @@ To configure per-route load balancing for an application that has not yet been p loadbalancing: least-connection ``` - Where `MY-APP` is the name of your app and `MY-APP.EXAMPLE.COM` is the route you want to map to your app. + Where `MY-APP` is the name of your app and `MY-HOST.EXAMPLE.COM` is the route you want to map to your app. 1. Push the app with the manifest: @@ -49,11 +49,11 @@ To configure per-route load balancing for an application that has not yet been p cf push -f manifest.yml ``` -2. To verify the option value, you can query the route using the cli route command `route` (see Chapter `Retrieve Route Options`). +2. To verify the option value, you can query the route using the cli route command `route` (see chapter `Retrieve Route Options`). The response lists the chosen `loadbalancing` algorithm option: ``` - options: {loadbalancing=least-connection} + options: {loadbalancing=least-connection} ``` Alternatively, you can query the `routes` API endpoint for the app's route: @@ -81,7 +81,7 @@ For example, to change an app route's algorithm from `least-connection` to `roun The response lists the changed `loadbalancing` algorithm option: ``` - options: {loadbalancing: round-robin} + options: {loadbalancing=round-robin} ``` Alternatively, it is also possible to `cf curl` the `/v3/routes` API. @@ -122,11 +122,11 @@ For example: ``` cf create-route EXAMPLE.COM --host MY-HOST --option=loadbalancing=round-robin ``` -2. To verify the option value, you can query the route using the cli route command `route` (see Chapter `Retrieve Route Options`). +2. To verify the option value, you can query the route using the cli route command `route` (see chapter `Retrieve Route Options`). The response lists the changed `loadbalancing` algorithm option: ``` - options: { loadbalancing: round-robin } + options: {loadbalancing=round-robin} ``` ### Mapping a New Route to an Existing App with a specified Load Balancing Algorithm @@ -143,11 +143,11 @@ For example: ``` cf map-route MY-APP EXAMPLE.COM --hostname MY-HOST --option loadbalancing=round-robin ``` -2. To verify the option value, you can query the route using the cli route command `route` (see Chapter `Retrieve Route Options`). +2. To verify the option value, you can query the route using the cli route command `route` (see chapter `Retrieve Route Options`). The response lists the changed `loadbalancing` algorithm option: ``` - options: { loadbalancing: round-robin } + options: { loadbalancing=round-robin } ``` ### Retrieve Route Options @@ -158,5 +158,5 @@ To verify route options, you can query the route using the `route` command: ``` The response lists the chosen `loadbalancing` algorithm option, e.g. `loadbalancing`: ``` - options: {loadbalancing=least-connection} + options: {loadbalancing=least-connection} ``` From 9180f0048c1c5e8ac5460a4f21ce53a65fb3c0df Mon Sep 17 00:00:00 2001 From: Daria <66593181+Dariquest@users.noreply.github.com> Date: Wed, 5 Feb 2025 18:06:32 +0100 Subject: [PATCH 16/22] Remove repeating route check sections --- custom-per-route-options.html.md.erb | 78 ++++++++++------------------ 1 file changed, 28 insertions(+), 50 deletions(-) diff --git a/custom-per-route-options.html.md.erb b/custom-per-route-options.html.md.erb index d9314a8c..4ad56869 100644 --- a/custom-per-route-options.html.md.erb +++ b/custom-per-route-options.html.md.erb @@ -49,42 +49,18 @@ To configure per-route load balancing for an application that has not yet been p cf push -f manifest.yml ``` -2. To verify the option value, you can query the route using the cli route command `route` (see chapter `Retrieve Route Options`). - - The response lists the chosen `loadbalancing` algorithm option: - ``` - options: {loadbalancing=least-connection} - ``` - Alternatively, you can query the `routes` API endpoint for the app's route: - - ``` - cf curl /v3/routes/?hosts=MY-HOST - ``` - - Where `MY-HOST` is the host attribute of the route. The response lists the chosen `loadbalancing` algorithm setting: - - ``` - "options": {"loadbalancing": "least-connection"} - ``` - ### Change Load Balancing of an Existing App To change the per-route `loadbalancing` option of an existing route, you can use the cli command, `update-route`. -For example, to change an app route's algorithm from `least-connection` to `round-robin`: +For example, to change an app route's algorithm from `least-connection` to `round-robin`, you can run the `update-route` command: -1. Run the update-route command: ``` - cf update-route EXAMPLE.COM --host MY-HOST --option=loadbalancing=round-robin + cf update-route EXAMPLE.COM --host MY-HOST --option loadbalancing=round-robin ``` -2. To verify the option value, you can query the route using the cli route command `route` (see Chapter `Retrieve Route Options`). - The response lists the changed `loadbalancing` algorithm option: - ``` - options: {loadbalancing=round-robin} - ``` +Alternatively, it is also possible to `cf curl` the `/v3/routes` API. - Alternatively, it is also possible to `cf curl` the `/v3/routes` API. 1. Run the `PATCH` request to the targeted API endpoint: ``` @@ -98,7 +74,7 @@ For example, to change an app route's algorithm from `least-connection` to `roun Where `GUID` is the unique identifier for the route. -2. To confirm the setting, query the `routes` API endpoint for the route: +1. To confirm the setting, query the `routes` API endpoint for the route: ``` cf curl /v3/routes/GUID @@ -115,48 +91,50 @@ For example, to change an app route's algorithm from `least-connection` to `roun ``` ### Creating a Route with a specified Load Balancing Algorithm -To create a route with the per-route `loadbalancing` option, you can use the cli command `create-route`. -For example: -1. Run the create-route command: - ``` - cf create-route EXAMPLE.COM --host MY-HOST --option=loadbalancing=round-robin - ``` -2. To verify the option value, you can query the route using the cli route command `route` (see chapter `Retrieve Route Options`). +To create a route with a per-route `loadbalancing` option, you can use the cli command `create-route`. +For example: - The response lists the changed `loadbalancing` algorithm option: ``` - options: {loadbalancing=round-robin} + cf create-route EXAMPLE.COM --host MY-HOST --option loadbalancing=round-robin ``` -### Mapping a New Route to an Existing App with a specified Load Balancing Algorithm +### Mapping a New Route to an Existing App with a specified Load Balancing Algorithm To create and map a new route to an existing application with the per-route `loadbalancing` option, you can use the cli command `map-route`. +For example: + + ``` + cf map-route MY-APP EXAMPLE.COM --hostname MY-HOST --option loadbalancing=round-robin + ``` +

The command map-route supports the --option flag only for new routes. To update an existing route, the command update-route must be used as described before.

-For example: +### Retrieve Route Options + +To verify route options, you can query the route using the `route` command: -1. Run a map-route command: ``` - cf map-route MY-APP EXAMPLE.COM --hostname MY-HOST --option loadbalancing=round-robin + cf route EXAMPLE.COM --hostname MY-HOST ``` -2. To verify the option value, you can query the route using the cli route command `route` (see chapter `Retrieve Route Options`). - - The response lists the changed `loadbalancing` algorithm option: + + The response lists the chosen `loadbalancing` algorithm option, e.g. `least-connection`: + ``` - options: { loadbalancing=round-robin } + options: {loadbalancing=least-connection} ``` -### Retrieve Route Options + Alternatively, you can query the `routes` API endpoint for the app's route: -To verify route options, you can query the route using the `route` command: ``` - cf route EXAMPLE.COM --hostname MY-HOST + cf curl /v3/routes/?hosts=MY-HOST ``` - The response lists the chosen `loadbalancing` algorithm option, e.g. `loadbalancing`: + + Where `MY-HOST` is the host attribute of the route. The response lists the chosen `loadbalancing` algorithm option as well: + ``` - options: {loadbalancing=least-connection} + "options": {"loadbalancing": "least-connection"} ``` From 907f00a54c2d77fd6255a65aa160e3f718a87236 Mon Sep 17 00:00:00 2001 From: Daria <66593181+Dariquest@users.noreply.github.com> Date: Wed, 5 Feb 2025 18:23:41 +0100 Subject: [PATCH 17/22] Chapter adjustments --- custom-per-route-options.html.md.erb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/custom-per-route-options.html.md.erb b/custom-per-route-options.html.md.erb index 4ad56869..33ba556b 100644 --- a/custom-per-route-options.html.md.erb +++ b/custom-per-route-options.html.md.erb @@ -49,7 +49,7 @@ To configure per-route load balancing for an application that has not yet been p cf push -f manifest.yml ``` -### Change Load Balancing of an Existing App +### Change Load Balancing of an Existing Route To change the per-route `loadbalancing` option of an existing route, you can use the cli command, `update-route`. @@ -74,7 +74,7 @@ Alternatively, it is also possible to `cf curl` the `/v3/routes` API. Where `GUID` is the unique identifier for the route. -1. To confirm the setting, query the `routes` API endpoint for the route: +1. To confirm the option, query the `routes` API endpoint for the route: ``` cf curl /v3/routes/GUID @@ -82,7 +82,7 @@ Alternatively, it is also possible to `cf curl` the `/v3/routes` API. Where `GUID` is the unique identifier for the route. - The response lists the new `round-robin` setting: + The response lists the new `round-robin` option: ``` "options": { @@ -90,7 +90,7 @@ Alternatively, it is also possible to `cf curl` the `/v3/routes` API. } ``` -### Creating a Route with a specified Load Balancing Algorithm +### Creating a Route with a specified Load Balancing Algorithm To create a route with a per-route `loadbalancing` option, you can use the cli command `create-route`. For example: @@ -127,7 +127,7 @@ To verify route options, you can query the route using the `route` command: options: {loadbalancing=least-connection} ``` - Alternatively, you can query the `routes` API endpoint for the app's route: + Alternatively, you can query the `routes` API endpoint for a route: ``` cf curl /v3/routes/?hosts=MY-HOST From f71173687f6468badd0e97529a39df3b80d60f8b Mon Sep 17 00:00:00 2001 From: Daria <66593181+Dariquest@users.noreply.github.com> Date: Thu, 6 Feb 2025 12:01:04 +0100 Subject: [PATCH 18/22] Last review round --- custom-per-route-options.html.md.erb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/custom-per-route-options.html.md.erb b/custom-per-route-options.html.md.erb index 33ba556b..8c29de93 100644 --- a/custom-per-route-options.html.md.erb +++ b/custom-per-route-options.html.md.erb @@ -59,7 +59,7 @@ For example, to change an app route's algorithm from `least-connection` to `roun cf update-route EXAMPLE.COM --host MY-HOST --option loadbalancing=round-robin ``` -Alternatively, it is also possible to `cf curl` the `/v3/routes` API. +Alternatively, it is also possible to update the per-route load balancing option via the `/v3/routes` API. 1. Run the `PATCH` request to the targeted API endpoint: @@ -90,7 +90,7 @@ Alternatively, it is also possible to `cf curl` the `/v3/routes` API. } ``` -### Creating a Route with a specified Load Balancing Algorithm +### Create a Route with a specific Load Balancing Algorithm To create a route with a per-route `loadbalancing` option, you can use the cli command `create-route`. For example: @@ -99,7 +99,7 @@ For example: cf create-route EXAMPLE.COM --host MY-HOST --option loadbalancing=round-robin ``` -### Mapping a New Route to an Existing App with a specified Load Balancing Algorithm +### Map a Route to an Existing App with specific Load Balancing Algorithm To create and map a new route to an existing application with the per-route `loadbalancing` option, you can use the cli command `map-route`. From 985c202247030151255d320a99869e81dfd37ebc Mon Sep 17 00:00:00 2001 From: Daria <66593181+Dariquest@users.noreply.github.com> Date: Thu, 6 Feb 2025 12:27:09 +0100 Subject: [PATCH 19/22] Add api way to create a route with a per-route option --- custom-per-route-options.html.md.erb | 32 +++++++++++++--------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/custom-per-route-options.html.md.erb b/custom-per-route-options.html.md.erb index 8c29de93..83de6725 100644 --- a/custom-per-route-options.html.md.erb +++ b/custom-per-route-options.html.md.erb @@ -61,7 +61,7 @@ For example, to change an app route's algorithm from `least-connection` to `roun Alternatively, it is also possible to update the per-route load balancing option via the `/v3/routes` API. -1. Run the `PATCH` request to the targeted API endpoint: +Run the `PATCH` request to the targeted API endpoint: ``` cf curl /v3/routes/GUID -X PATCH -H "Content-type: application/json" \ @@ -74,22 +74,6 @@ Alternatively, it is also possible to update the per-route load balancing option Where `GUID` is the unique identifier for the route. -1. To confirm the option, query the `routes` API endpoint for the route: - - ``` - cf curl /v3/routes/GUID - ``` - - Where `GUID` is the unique identifier for the route. - - The response lists the new `round-robin` option: - - ``` - "options": { - "loadbalancing": "round-robin" - } - ``` - ### Create a Route with a specific Load Balancing Algorithm To create a route with a per-route `loadbalancing` option, you can use the cli command `create-route`. @@ -99,6 +83,20 @@ For example: cf create-route EXAMPLE.COM --host MY-HOST --option loadbalancing=round-robin ``` +Alternatively, it is also possible to create a route with a per-route load balancing option via the `/v3/routes` API: + + ``` + cf curl /v3/routes -X POST -H "Content-type: application/json" \ + -d '{ + "host": "MY-HOST", + "path": "MY-PATH", + ... + "options": { + "loadbalancing": "round-robin" + } + }' + ``` + ### Map a Route to an Existing App with specific Load Balancing Algorithm To create and map a new route to an existing application with the per-route `loadbalancing` option, you can use the cli command `map-route`. From 864568685ab4cbcf3a4e5ee1df2492ca0d00b2e2 Mon Sep 17 00:00:00 2001 From: Daria <66593181+Dariquest@users.noreply.github.com> Date: Thu, 6 Feb 2025 12:31:45 +0100 Subject: [PATCH 20/22] Tags correction --- custom-per-route-options.html.md.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom-per-route-options.html.md.erb b/custom-per-route-options.html.md.erb index 83de6725..560ab957 100644 --- a/custom-per-route-options.html.md.erb +++ b/custom-per-route-options.html.md.erb @@ -49,7 +49,7 @@ To configure per-route load balancing for an application that has not yet been p cf push -f manifest.yml ``` -### Change Load Balancing of an Existing Route +### Change Load Balancing Algorithm of an Existing Route To change the per-route `loadbalancing` option of an existing route, you can use the cli command, `update-route`. From c823864511fe9cab95195f3423d7599378931d7f Mon Sep 17 00:00:00 2001 From: Daria <66593181+Dariquest@users.noreply.github.com> Date: Thu, 6 Feb 2025 14:16:29 +0100 Subject: [PATCH 21/22] word-level improvement Co-authored-by: Clemens Hoffmann --- custom-per-route-options.html.md.erb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/custom-per-route-options.html.md.erb b/custom-per-route-options.html.md.erb index 560ab957..711cd7c4 100644 --- a/custom-per-route-options.html.md.erb +++ b/custom-per-route-options.html.md.erb @@ -113,7 +113,7 @@ To update an existing route, the command update-route must be used ### Retrieve Route Options -To verify route options, you can query the route using the `route` command: +To read route options, you can query the route using the `route` command: ``` cf route EXAMPLE.COM --hostname MY-HOST From a6546209d78c23b8dc1801e8497b77fcb41755d2 Mon Sep 17 00:00:00 2001 From: Daria <66593181+Dariquest@users.noreply.github.com> Date: Thu, 6 Feb 2025 14:21:56 +0100 Subject: [PATCH 22/22] add cf routes command doc --- custom-per-route-options.html.md.erb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/custom-per-route-options.html.md.erb b/custom-per-route-options.html.md.erb index 711cd7c4..0b0d560e 100644 --- a/custom-per-route-options.html.md.erb +++ b/custom-per-route-options.html.md.erb @@ -136,3 +136,5 @@ To read route options, you can query the route using the `route` command: ``` "options": {"loadbalancing": "least-connection"} ``` + +To retrieve all the routes with the corresponding options in a space of an organization, you can use `routes` command.