Skip to content

Backport of Adding support for weighted k8s service into release/1.1.x#2401

Merged
thisisnotashwin merged 10 commits intorelease/1.1.xfrom
backport/srahul3/support-for-weighted-k8s-service/virtually-magical-wasp
Jun 21, 2023
Merged

Backport of Adding support for weighted k8s service into release/1.1.x#2401
thisisnotashwin merged 10 commits intorelease/1.1.xfrom
backport/srahul3/support-for-weighted-k8s-service/virtually-magical-wasp

Conversation

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

Backport

This PR is auto-generated from #2293 to be assessed for backporting due to the inclusion of the label backport/1.1.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/virtually-magical-wasp branch 2 times, most recently from adbffdb to a9171cf Compare June 19, 2023 17:50
@thisisnotashwin thisisnotashwin force-pushed the backport/srahul3/support-for-weighted-k8s-service/virtually-magical-wasp branch from a9171cf to 706dbe2 Compare June 21, 2023 13:22
@thisisnotashwin thisisnotashwin marked this pull request as ready for review June 21, 2023 13:23
@thisisnotashwin thisisnotashwin enabled auto-merge (squash) June 21, 2023 13:28
@thisisnotashwin thisisnotashwin merged commit c98a021 into release/1.1.x Jun 21, 2023
@thisisnotashwin thisisnotashwin deleted the backport/srahul3/support-for-weighted-k8s-service/virtually-magical-wasp branch June 21, 2023 14:08
@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