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

fine-grained control over canary: add canary-weight-total to configure the total weight #6338

Merged
merged 1 commit into from
Dec 7, 2021

Conversation

cofyc
Copy link
Member

@cofyc cofyc commented Oct 16, 2020

What this PR does / why we need it:

Try to fine-grained control over canary weight.

Alternatively, we can allow the fraction part in the canary-weight, but how many fraction digits should we allow?

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Which issue/s this PR fixes

fixes #6337

How Has This Been Tested?

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I've read the CONTRIBUTION guide
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Oct 16, 2020
config.WeightTotal, err = parser.GetIntAnnotation("canary-weight-total", ing)
if err != nil {
config.WeightTotal = 100
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

in Lua script, < 100 value is ignored and the value defaults to 100, should we add this logic here too?

@aledbf
Copy link
Member

aledbf commented Oct 16, 2020

/assign @ElvinEfendi

@codecov-io
Copy link

codecov-io commented Oct 16, 2020

Codecov Report

Merging #6338 into master will increase coverage by 0.05%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #6338      +/-   ##
==========================================
+ Coverage   55.81%   55.87%   +0.05%     
==========================================
  Files          89       89              
  Lines        6358     6362       +4     
==========================================
+ Hits         3549     3555       +6     
+ Misses       2369     2368       -1     
+ Partials      440      439       -1     
Impacted Files Coverage Δ
internal/ingress/controller/nginx.go 28.91% <ø> (ø)
internal/ingress/types.go 0.00% <ø> (ø)
internal/ingress/annotations/canary/main.go 100.00% <100.00%> (ø)
internal/ingress/controller/controller.go 46.99% <100.00%> (+0.06%) ⬆️
internal/ingress/metric/collectors/process.go 90.47% <0.00%> (+2.38%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update fb6a03f...bd9424e. Read the comment docs.

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 17, 2021
@cofyc
Copy link
Member Author

cofyc commented Jan 17, 2021

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Jan 17, 2021
@cofyc
Copy link
Member Author

cofyc commented Feb 9, 2021

@ElvinEfendi what do you think?

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-contributor-experience at kubernetes/community.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 10, 2021
@rikatz
Copy link
Contributor

rikatz commented May 30, 2021

/kind feature

@k8s-ci-robot k8s-ci-robot added the kind/feature Categorizes issue or PR as related to a new feature. label May 30, 2021
@cofyc
Copy link
Member Author

cofyc commented May 31, 2021

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label May 31, 2021
@rikatz rikatz changed the base branch from master to dev-v1 July 16, 2021 12:44
@rikatz rikatz changed the base branch from dev-v1 to main July 27, 2021 15:31
@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jul 30, 2021
@k8s-triage-robot
Copy link

The Kubernetes project currently lacks enough contributors to adequately respond to all issues and PRs.

This bot triages issues and PRs according to the following rules:

  • After 90d of inactivity, lifecycle/stale is applied
  • After 30d of inactivity since lifecycle/stale was applied, lifecycle/rotten is applied
  • After 30d of inactivity since lifecycle/rotten was applied, the issue is closed

You can:

  • Mark this issue or PR as fresh with /remove-lifecycle stale
  • Mark this issue or PR as rotten with /lifecycle rotten
  • Close this issue or PR with /close
  • Offer to help out with Issue Triage

Please send feedback to sig-contributor-experience at kubernetes/community.

/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Oct 28, 2021
@iamNoah1
Copy link
Contributor

@cofyc can you please rebase, and then we should follow up @rikatz

@iamNoah1
Copy link
Contributor

@cofyc build is failing

@cofyc
Copy link
Member Author

cofyc commented Nov 16, 2021

working on it

@cofyc
Copy link
Member Author

cofyc commented Nov 17, 2021

@cofyc build is failing

fixed

Copy link
Contributor

@iamNoah1 iamNoah1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Nov 17, 2021
@cofyc
Copy link
Member Author

cofyc commented Nov 17, 2021

/remove-lifecycle stale

@k8s-ci-robot k8s-ci-robot removed the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Nov 17, 2021
@larivierec
Copy link
Contributor

larivierec commented Nov 17, 2021

Maybe I'm missing context but it seems that weight is the same thing as weight total except for the fact that we can go to 1000.

Shouldn't we simply reuse the weight variable?
What happens if we put both Weight and Weight Total?

Update: after reading the docs, I see that both are needed in order to be used one allows you to increase the other.
Shouldn't the original variable Weight be converted to a float instead?

@iamNoah1
Copy link
Contributor

@cofyc friendly ping to consider the comment of @larivierec

@cofyc
Copy link
Member Author

cofyc commented Nov 22, 2021

I think it's a good idea if it's ok to convert nginx.ingress.kubernetes.io/canary-weight to float.

@iamNoah1
Copy link
Contributor

@cofyc @larivierec my opinion on this is, even though it may make sense, let's just get this PR merged if everything is fine. Having the possibility to be more precise on the weight using float can be a follow-up issue.

@larivierec
Copy link
Contributor

doesn't bother me, we should create an issue to follow up though

@iamNoah1
Copy link
Contributor

created a follow up issue: #7971 @cofyc @larivierec FYI

@iamNoah1
Copy link
Contributor

/triage accepted
/priority backlog

@k8s-ci-robot k8s-ci-robot added triage/accepted Indicates an issue or PR is ready to be actively worked on. priority/backlog Higher priority than priority/awaiting-more-evidence. labels Nov 24, 2021
@strongjz
Copy link
Member

strongjz commented Dec 7, 2021

/lgtm

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: cofyc, iamNoah1, strongjz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Dec 7, 2021
@k8s-ci-robot k8s-ci-robot merged commit 5cff197 into kubernetes:main Dec 7, 2021
@strongjz strongjz mentioned this pull request Dec 7, 2021
@rikatz rikatz added this to the v1.1.1 milestone Jan 9, 2022
rchshld pushed a commit to joomcode/ingress-nginx that referenced this pull request May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. area/docs area/lua Issues or PRs related to lua code cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. kind/feature Categorizes issue or PR as related to a new feature. lgtm "Looks good to me", indicates that a PR is ready to be merged. priority/backlog Higher priority than priority/awaiting-more-evidence. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. triage/accepted Indicates an issue or PR is ready to be actively worked on.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

fine-grained control over canary weight, e.g. 0.1%