Skip to content

Backport of Adding support for weighted k8s service into release/1.2.x#2402

Merged
thisisnotashwin merged 10 commits intorelease/1.2.xfrom
backport/srahul3/support-for-weighted-k8s-service/implicitly-sunny-sparrow
Jun 21, 2023
Merged

Backport of Adding support for weighted k8s service into release/1.2.x#2402
thisisnotashwin merged 10 commits intorelease/1.2.xfrom
backport/srahul3/support-for-weighted-k8s-service/implicitly-sunny-sparrow

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.2.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/implicitly-sunny-sparrow branch from f4ab9a8 to 1eb2e49 Compare June 19, 2023 17:50
@thisisnotashwin thisisnotashwin force-pushed the backport/srahul3/support-for-weighted-k8s-service/implicitly-sunny-sparrow branch from 1eb2e49 to 4c9478f Compare June 21, 2023 13:24
@thisisnotashwin thisisnotashwin marked this pull request as ready for review June 21, 2023 13:24
@thisisnotashwin thisisnotashwin enabled auto-merge (squash) June 21, 2023 13:29
@thisisnotashwin thisisnotashwin merged commit b9caeb1 into release/1.2.x Jun 21, 2023
@thisisnotashwin thisisnotashwin deleted the backport/srahul3/support-for-weighted-k8s-service/implicitly-sunny-sparrow branch June 21, 2023 13:52
thisisnotashwin added a commit that referenced this pull request Jun 21, 2023
#2402)

* backport of commit fdef617
* backport of commit 7d47c00
* backport of commit 552c0e7
* backport of commit 14fa790
* backport of commit 9f396c3
* backport of commit 3320b62
* backport of commit dc3e24e
* backport of commit 3dad9a0
* backport of commit 95b3f7c
* backport of commit fa54600

---------

Co-authored-by: srahul3 <rahulsharma@hashicorp.com>
Co-authored-by: Ashwin Venkatesh <ashwin.what@gmail.com>
@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