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

[fix] [improvement] move apiserver loadbalancing logic from linodemachine controller to linodecluster controller #457

Merged
merged 41 commits into from
Aug 21, 2024

Conversation

amold1
Copy link
Contributor

@amold1 amold1 commented Aug 15, 2024

What this PR does / why we need it:
For APIServer LoadBalancing, we are currently creating NB or DNS entries from the LinodeMachine controller causing inconsistencies during the creation/deletion process leading to either failed attempts to create a cluster or some DNS Entries being left behind. We had also turned off concurrency to mitigate these issues but that hasn't proven to be a good solution.

This PR now moves all of the logic to the LinodeCluster controller allowing it to accurately access what DNS entries or NB backends need to be added or deleted.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

Special notes for your reviewer:

TODOs:

  • squashed commits
  • includes documentation
  • adds unit tests
  • adds or updates e2e tests

Copy link

codecov bot commented Aug 15, 2024

Codecov Report

Attention: Patch coverage is 61.26761% with 110 lines in your changes missing coverage. Please review.

Project coverage is 64.53%. Comparing base (86d3a25) to head (2dda21f).
Report is 1 commits behind head on main.

Files Patch % Lines
controller/linodecluster_controller.go 21.53% 47 Missing and 4 partials ⚠️
cloud/services/domains.go 75.00% 20 Missing and 5 partials ⚠️
controller/linodecluster_controller_helpers.go 40.00% 9 Missing and 3 partials ⚠️
cloud/services/loadbalancers.go 82.45% 6 Missing and 4 partials ⚠️
cloud/scope/cluster.go 78.94% 2 Missing and 2 partials ⚠️
controller/linodemachine_controller.go 0.00% 2 Missing and 2 partials ⚠️
cmd/main.go 0.00% 2 Missing ⚠️
controller/linodemachine_controller_helpers.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #457      +/-   ##
==========================================
- Coverage   65.33%   64.53%   -0.81%     
==========================================
  Files          80       81       +1     
  Lines        4192     4196       +4     
==========================================
- Hits         2739     2708      -31     
- Misses       1243     1278      +35     
  Partials      210      210              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@amold1 amold1 changed the title [fix] [improvement] move apiserver loadbalacing logic from linodemachine controller to linodecluster controller [fix] [improvement] move apiserver loadbalancing logic from linodemachine controller to linodecluster controller Aug 15, 2024
@amold1 amold1 marked this pull request as ready for review August 17, 2024 20:00
@AshleyDumaine
Copy link
Member

Changes look good to me, can you rebase off main and squash @amold1 ? 🙏

portsToBeAdded = append(portsToBeAdded, map[string]int{"configID": *portConfig.NodeBalancerConfigID, "port": portConfig.Port})
}

logger.Info("abir", "portsToBeAdded", portsToBeAdded)
Copy link
Member

Choose a reason for hiding this comment

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

whoops, missed leftover debugging

Copy link
Contributor Author

Choose a reason for hiding this comment

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

oops... removed!

@amold1
Copy link
Contributor Author

amold1 commented Aug 21, 2024

Changes look good to me, can you rebase off main and squash @amold1 ? 🙏

rebased and checks running now - I'll "squash and merge" on approval

Copy link
Member

@AshleyDumaine AshleyDumaine left a comment

Choose a reason for hiding this comment

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

Working for me on latest changes 👍

@amold1 amold1 merged commit 3a074f0 into main Aug 21, 2024
11 of 13 checks passed
@eljohnson92 eljohnson92 deleted the dns.cleanup branch September 20, 2024 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants