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

Add support for setting service weights via annotations in Kubernetes Catalog Sync #1455

Closed
azalenski-branch opened this issue Aug 26, 2022 · 0 comments · Fixed by #2293
Closed
Labels
area/sync Related to catalog sync type/enhancement New feature or request

Comments

@azalenski-branch
Copy link

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request. Searching for pre-existing feature requests helps us consolidate datapoints for identical requirements into a single place, thank you!
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment.

Is your feature request related to a problem? Please describe.

According to the documentation Consul supports setting weights for services . Unfortunately currently there is no way of doing that when using consul-k8s, as there is no annotation that can control that + there is no easy way of doing it via Consul API and it looks like the changes will be anyway overwritten.

Feature Description

What would be very useful it to add an additional annotation similar to the existing ones for Consul Catalog Sync, that would control the weights parameter of the service. An example annotation would look like this:

consul.hashicorp.com/service-weight: <number>

This would be later on mapped to the weights parameter for all pods of the respective service.

Use Case(s)

There are multiple use-cases where such annotation will come in handy for the Service Discovery mechanism. An example:

Setting weights for Consul services that span across multiple Kubernetes clusters. Having such annotation would allow us to set weight on example-service deployed on ClusterA to 25% and weight on same service example-service deployed on ClusterB to 75%. This allows to perform weighted routing and can be useful in multiple scenarios such as:

  • Canary releases
  • Haproxy/Nginx Weighted Load Balancing
  • Traffic splitting

Contributions

With some guidance, I can try to prepare an initial PR with the new feature.

@azalenski-branch azalenski-branch added the type/enhancement New feature or request label Aug 26, 2022
@blake blake added the area/sync Related to catalog sync label Feb 11, 2023
@david-yu david-yu linked a pull request Jun 15, 2023 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/sync Related to catalog sync type/enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants