Skip to content

Conversation

@hoffmaen
Copy link
Contributor

@hoffmaen hoffmaen commented Jan 9, 2026

This Pull-Request replaces #4696.

This Pull-Request adds support for hash-based routing to Cloud Controller.

Summary:
The routes model is enhanced as follows:

  • hash is added as a valid loadbalancing option
  • hash_header is added as a per-route option. The option is mandatory when loadbalancing=hash
  • hash_balance is added as a per-route option. The option is optional when loadbalancing=hash

Validation of these options is added when creating and updating both via API and via manifest. All validations that do not need the context of a potentially existing route during an update, are executed in the message:

  • Hash Balance must be numeric
  • Hash Header and Hash Balance must not be specified together with round-robin or least-connection
  • Values for Hash Header and Hash Balance must not be arbitrarily long

Further validations and cleanups are performed on the route model, as they need the context of existing routes:

  • The route options from the update message are merged with existing routes, when existing
  • When the loadbalancing algorithm is hash, then Hash Header must be specified
  • When the loadbalancing algorithm is switched from hash to something else (or when it is removed), also Hash Header and Hash Balance options are removed
  • Hash Balance is always stored as a string, and is always trimmed to a numeric value with one decimal place

The route options are still stored as a raw JSON string in the routes table.

Links:

Thanks for contributing to cloud_controller_ng. To speed up the process of reviewing your pull request please provide us with:

  • A short explanation of the proposed change:

  • An explanation of the use cases your change solves

  • Links to any other associated PRs

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

@hoffmaen hoffmaen mentioned this pull request Jan 9, 2026
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant