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

AWSSD: Cleanup empty Services #2510

Merged

Conversation

voro015
Copy link
Contributor

@voro015 voro015 commented Jan 10, 2022

Description

AWSSD provider aka AWS CloudMap should remove CloudMap Services when its last Instance de-registered.

  • Added new flag aws-sd-service-cleanup to enable cleanup of stale CM Services, by default it will work as before;
    Opened for another flag name
  • Updated submitCreates to respect Service ownership and update only "owned" Services
  • Added DeleteService handler to cleanup empty CM Services from CloudMap using DeleteService API
  • Updated AWSSDProvider struct to include ownerID and cleanEmptyService flag;
    I'm not sure if it could be done without updating provider struct without heavy-lifting.
    In current awssd implementation only registry is aware of TXTOwnerID and it cannot be easily passed without changing Provider interface, same time only provider aware when last Instance was Deregistered(Service cannot be deleted until all Instances are gone).
  • Updated tests

Fixes #2509

This feature is critical when external-dns is used with awssd provider on high scale of Endpoints, when no cleanup preformed at some point CM Namespace will contain mostly orphaned empty CM Services and reconciliation will take tens of minutes to run.

Checklist

  • Unit tests updated
  • End user documentation updated

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jan 10, 2022
@k8s-ci-robot k8s-ci-robot added the size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Jan 10, 2022
Copy link
Member

@njuettner njuettner 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 Feb 12, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: njuettner, voro015

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 Feb 12, 2022
@k8s-ci-robot k8s-ci-robot merged commit 06405ed into kubernetes-sigs:master Feb 12, 2022
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AWSSD: Cleanup empty Service
3 participants