Skip to content

improve missing service handling for targetGroupBinding #1888

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 1 commit into from
Mar 18, 2021

Conversation

M00nF1sh
Copy link
Collaborator

improve missing service handling for targetGroupBinding

This PR improves missing service handling for targetGroupBinding as follows:

  1. for IP target-type, the targets and networking rules on worker nodes managed by TGB will cleaned up if any of below criteria meet:
    • the Service object referenced by TGB is not found
    • the Service object referenced by TGB don't contain referenced port.
    • the Endpoints object for corresponding Service object referenced by TGB is not found.
  2. For Instance target-type, the targets and networking rules on worker nodes managed by TGB will cleaned up if any of below criteria meet:
    • the Service object referenced by TGB is not found
    • the Service object referenced by TGB don't contain referenced port.

Fixes #1879

Test done

  1. create service(svc-1) and ingress(ing-1) referencing it.
  2. delete svc-1(but keep the ingress ing-1)
    • observed targets and networking rules on worker nodes been cleaned up.
    • observed a warning issues to the TGB object Warning BackendNotFound 64s targetGroupBinding backend not found: Service "service-2048" not found Normal SuccessfullyReconciled 63s (x5 over 90s) targetGroupBinding Successfully reconciled

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. labels Mar 17, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: M00nF1sh

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 Mar 17, 2021
@k8s-ci-robot k8s-ci-robot requested a review from kishorj March 17, 2021 20:28
"k8s.io/apimachinery/pkg/types"
"k8s.io/apimachinery/pkg/util/intstr"
"sigs.k8s.io/aws-load-balancer-controller/pkg/k8s"
"sigs.k8s.io/controller-runtime/pkg/client"
)

var ErrNotFound = errors.New("backend not found")
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit:
The error message contains redundant "not found" phrase . For example,
"backend not found: services "svc-1" not found"

I am more inclined to have something like -
"backend: services "svc-1" not found"
or
"backend error: services "svc-1" not found"

@kishorj kishorj added the tide/merge-method-squash Denotes a PR that should be squashed by tide when it merges. label Mar 18, 2021
@kishorj
Copy link
Collaborator

kishorj commented Mar 18, 2021

/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 18, 2021
@k8s-ci-robot k8s-ci-robot merged commit 661423d into kubernetes-sigs:main Mar 18, 2021
Timothy-Dougherty pushed a commit to adammw/aws-load-balancer-controller that referenced this pull request Nov 9, 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. 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. size/L Denotes a PR that changes 100-499 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.

Ingress is stuck while deleting. Cause AWS-LoadBalancer-Controller is not able to delete the ALB Security group it has created.
3 participants