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

Backport of Adding support for weighted k8s service into release/1.0.x #2403

Conversation

hc-github-team-consul-core
Copy link
Collaborator

Backport

This PR is auto-generated from #2293 to be assessed for backporting due to the inclusion of the label backport/1.0.x.

🚨

Warning automatic cherry-pick of commits failed. If the first commit failed,
you will see a blank no-op commit below. If at least one commit succeeded, you
will see the cherry-picked commits up to, not including, the commit where
the merge conflict occurred.

The person who merged in the original PR is:
@srahul3
This person should manually cherry-pick the original PR into a new backport PR,
and close this one when the manual backport PR is merged in.

merge conflict error: unable to process merge commit: "21984e971d14125c96444283ad676e8837a925ab", automatic backport requires rebase workflow

The below text is copied from the body of the original PR.


Context

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.

Related link: https://hashicorp.atlassian.net/browse/NET-4266

Changes proposed in this PR:

  • While the k8s syncs to consul, the LB service annotation consul.hashicorp.com/service-weight: <number> is read and then the weight is divided among underlying ingress/ips. The calculated weight is persisted as passing weight in consulapi.CatalogRegistration

How I've tested this PR:
Added the Junit test for different scenarios

How I expect reviewers to test this PR:

Checklist:

  • Tests added
  • CHANGELOG entry added

    HashiCorp engineers only, community PRs should not add a changelog entry.
    Entries should use present tense (e.g. Add support for...)


Overview of commits

@hc-github-team-consul-core hc-github-team-consul-core force-pushed the backport/srahul3/support-for-weighted-k8s-service/loudly-sincere-cattle branch from 6be05d4 to e867bee Compare June 19, 2023 17:50
@thisisnotashwin thisisnotashwin force-pushed the backport/srahul3/support-for-weighted-k8s-service/loudly-sincere-cattle branch from e867bee to d2a427c Compare June 21, 2023 13:25
@thisisnotashwin thisisnotashwin marked this pull request as ready for review June 21, 2023 13:25
@thisisnotashwin thisisnotashwin enabled auto-merge (squash) June 21, 2023 13:29
@thisisnotashwin thisisnotashwin merged commit c2b0f42 into release/1.0.x Jun 21, 2023
@thisisnotashwin thisisnotashwin deleted the backport/srahul3/support-for-weighted-k8s-service/loudly-sincere-cattle branch June 21, 2023 13:52
@srahul3 srahul3 added the consul-india PRs/Issues assigned to Consul India team label Dec 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
consul-india PRs/Issues assigned to Consul India team
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants