Skip to content

Update pods with readinessGate as healthy for deleted TGB #2524

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

Merged
merged 3 commits into from
Mar 15, 2022

Conversation

oliviassss
Copy link
Collaborator

@oliviassss oliviassss commented Feb 23, 2022

Issue

#2393
#1764

Description

To avoid race condition between pods readiness gate, this PR adds a step to mark podCondition with associated TargetGroupBinding's readinessGate as healthy when delete a TargetGroupBinding.

Test

  • Created ingress and deployment in the namespace with pod readinessGate enabled, triggered the ingress update and deployment rollout at the same time, verified that the pod's readinessGate status is 1/1, and the new target group is registered to the TargetGroupBinding.
  • Deleted the resources in the namespace with pod readinessGate enabled, verified these resources can be cleaned up successfully
  • Created and deleted ingress and deployment in the namespace with pod readinessGate diabled, verified these resources can be created and deleted successfully, no behavior change in this use case

Checklist

  • Added tests that cover your change (if possible)
  • Added/modified documentation as required (such as the README.md, or the docs directory)
  • Manually tested
  • Made sure the title of the PR is a good description that can go into the release notes

BONUS POINTS checklist: complete for good vibes and maybe prizes?! 🤯

  • Backfilled missing tests for code in same general area 🎉
  • Refactored something and made the world a better place 🌟

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Feb 23, 2022
@k8s-ci-robot
Copy link
Contributor

Hi @oliviassss. Thanks for your PR.

I'm waiting for a kubernetes-sigs 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.

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/test-infra repository.

@k8s-ci-robot k8s-ci-robot added needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Feb 23, 2022
@codecov-commenter
Copy link

codecov-commenter commented Feb 23, 2022

Codecov Report

Merging #2524 (9b99679) into main (779508f) will decrease coverage by 0.11%.
The diff coverage is 0.00%.

@@            Coverage Diff             @@
##             main    #2524      +/-   ##
==========================================
- Coverage   53.97%   53.85%   -0.12%     
==========================================
  Files         144      144              
  Lines        8147     8165      +18     
==========================================
  Hits         4397     4397              
- Misses       3433     3451      +18     
  Partials      317      317              
Impacted Files Coverage Δ
pkg/targetgroupbinding/resource_manager.go 15.27% <0.00%> (-1.02%) ⬇️

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 779508f...9b99679. Read the comment docs.

@kishorj
Copy link
Collaborator

kishorj commented Mar 1, 2022

/ok-to-test

@k8s-ci-robot k8s-ci-robot added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed needs-ok-to-test Indicates a PR that requires an org member to verify it is safe to test. labels Mar 1, 2022
@kishorj kishorj added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Mar 15, 2022
@kishorj
Copy link
Collaborator

kishorj commented Mar 15, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 15, 2022
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Mar 15, 2022
@kishorj
Copy link
Collaborator

kishorj commented Mar 15, 2022

/approve

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kishorj, oliviassss

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 needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Mar 15, 2022
@k8s-ci-robot k8s-ci-robot removed lgtm "Looks good to me", indicates that a PR is ready to be merged. needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. labels Mar 15, 2022
@kishorj
Copy link
Collaborator

kishorj commented Mar 15, 2022

/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Mar 15, 2022
@k8s-ci-robot k8s-ci-robot merged commit a18ab63 into kubernetes-sigs:main Mar 15, 2022
return err
}
if !exists {
return errors.New("couldn't find podInfo for ready endpoint")
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should just continue if pod not found.
we can fix it in future versions as it's rare to trigger and won't cause much defect.


allPodKeys := m.podInfoRepo.ListKeys(ctx)
for _, podKey := range allPodKeys {
pod, exists, err := m.podInfoRepo.Get(ctx, podKey)
Copy link
Collaborator

Choose a reason for hiding this comment

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

we should check for pod's namespace here as well.
Since in theory you can have two targetGroupBinding in two namespace.

In practice, with our default Ingress/Service implementation, the TGB's name is same as TargetGroup's name and will be unique across namespaces.
but this will impact user created targetGroupBinding.

we can fix it in future versions as the impact is minimal

@oliviassss oliviassss deleted the TGB_readiness branch May 15, 2023 19:06
Timothy-Dougherty pushed a commit to adammw/aws-load-balancer-controller that referenced this pull request Nov 9, 2023
…-sigs#2524)

* mark pod with readiness gate as healthy when deleting TGB

* list pod keys

Co-authored-by: Kishor Joshi <[email protected]>
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. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants