Skip to content

feat: add graceful stop annotation#486

Open
Bowser1704 wants to merge 1 commit into
kubernetes:masterfrom
Bowser1704:feat/graceful-stop
Open

feat: add graceful stop annotation#486
Bowser1704 wants to merge 1 commit into
kubernetes:masterfrom
Bowser1704:feat/graceful-stop

Conversation

@Bowser1704

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind feature

What this PR does / why we need it:

Adds a new Service annotation service.beta.kubernetes.io/alibaba-cloud-loadbalancer-graceful-shutdown.

When enabled for ENI backends, terminating EndpointSlice endpoints that are still serving are kept in CLB/NLB backend server groups with weight 0, allowing existing connections to drain before the backend is removed after pod termination completes.

This PR also adds unit tests and E2E coverage for CLB and NLB graceful shutdown behavior.

Which issue(s) this PR fixes:

Fixes #485

Special notes for your reviewer:

This feature applies to EndpointSlice-based reconciliation and ENI backend mode.

graceful-shutdown relies on backend weight updates to set terminating-but-serving backends to weight 0. If users also enable ignore-weight-update, the backend is kept in the server group but
the weight is not changed. In that case, users should enable connection-drain to reduce connection interruption risk when the backend is finally removed.

Does this PR introduce a user-facing change?

Add Service annotation `service.beta.kubernetes.io/alibaba-cloud-loadbalancer-graceful-shutdown` to support graceful backend draining for terminating ENI pods.

Additional documentation e.g., KEPs (Kubernetes Enhancement Proposals), usage docs, etc.:


@k8s-ci-robot k8s-ci-robot added kind/feature Categorizes issue or PR as related to a new feature. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. labels Jun 10, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

Hi @Bowser1704. Thanks for your PR.

I'm waiting for a kubernetes member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

@k8s-ci-robot k8s-ci-robot added the needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. label Jun 10, 2026
@k8s-ci-robot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: Bowser1704
Once this PR has been reviewed and has the lgtm label, please assign gujingit for approval. For more information see the Code Review Process.

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

Details 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 requested review from aoxn and gujingit June 10, 2026 09:45
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jun 10, 2026
@Bowser1704
Bowser1704 force-pushed the feat/graceful-stop branch 2 times, most recently from cb12aa3 to e328b2c Compare June 12, 2026 05:56
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 12, 2026
Signed-off-by: Hongqi Yu <bowser1704@gmail.com>
@Bowser1704
Bowser1704 force-pushed the feat/graceful-stop branch from e328b2c to a9bb3e6 Compare June 12, 2026 07:27
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jun 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

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. needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support graceful shutdown for CLB/NLB in ENI mode

2 participants