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

aws: delete CLBs after migration to NLB #14499

Merged
merged 1 commit into from Nov 6, 2022

Conversation

johngmyers
Copy link
Member

No description provided.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Nov 5, 2022
@k8s-ci-robot k8s-ci-robot added area/provider/aws Issues or PRs related to aws provider size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Nov 5, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: hakman

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 lgtm "Looks good to me", indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Nov 6, 2022
@rifelpet
Copy link
Member

rifelpet commented Nov 6, 2022

I think the reason we didn't implement this initially was that when migrating from CLB to NLB, we can't ensure that all traffic has migrated to the NLB in regards to DNS TTLs and the newly created NLB being ready for traffic.

If the kops CLI is performing this deletion at the same time it is creating the NLB then this could be disruptive to apiserver traffic. Is that not still the case?

@johngmyers
Copy link
Member Author

My testing shows that the CLB has all its targets removed once the first apply_cluster is done. So there's no point in keeping it.

If we can fix it so the existing instances stay registered, then we can uncomment the code here that delays deleting the CLB until it has no target instances.

@hakman
Copy link
Member

hakman commented Nov 6, 2022

Is that not still the case?

NLB is "created" first and deletions are done later. By created I mean it starts creating it and takes 2 mins. For sure there will be some downtime.
The difference is that it's been 2 years, and CLB is now marked as deprecated.
It is still manual process to switch, so operators should realise that there may be a certain downtime.

@hakman
Copy link
Member

hakman commented Nov 6, 2022

/hold in case there is some extra feedback

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 6, 2022
@hakman
Copy link
Member

hakman commented Nov 6, 2022

We could also add a WaitUntilLoadBalancerExists() or WaitUntilLoadBalancerAvailable() for the NLB, to make sure it exists (like is done for None DNS).

@johngmyers
Copy link
Member Author

If the CLB has all its targets deregistered, there's no point. There's going to be an interruption whether we tear down the CLB or not.

@rifelpet
Copy link
Member

rifelpet commented Nov 6, 2022

The instances are deregistered from the CLB because the UpdateAutoscalingGroup call no longer includes the CLB. I wonder if we could avoid that by keeping CLBs in the UpdateAutoscalingGroup call if we know we'll also be deleting that CLB. I suppose that depends on whether AWS allows you to a delete a CLB still attached to an ASG vs needing to remove it from the ASG first. It may not be worth the effort to implement this

@hakman
Copy link
Member

hakman commented Nov 6, 2022

It may not be worth the effort to implement this

That was my reasoning. CLB is more or less deprecated by AWS and (hopefully) fewer people continue to use it. We don't force operators to switch to NLB for API, so it should be reasonable for them to schedule a maintenance window with some downtime.

@rifelpet
Copy link
Member

rifelpet commented Nov 6, 2022

and (hopefully) fewer people continue to use it

All stable kops versions use it by default for new clusters (until #14410 is released in kops 1.26) so we can assume there are many kops clusters still using CLBs. If the 1.26 release notes mention that CLBs are deprecated then it would be nice if the migration path didn't incur apiserver downtime. Though docs/cluster_spec.md does mention that the migration will involve downtime, so maybe that is acceptable.

@johngmyers
Copy link
Member Author

Reducing or eliminating the downtime could be done in a subsequent PR. This PR doesn't make it worse, as it leaves a path to keeping the CLB around longer if need be.

@rifelpet
Copy link
Member

rifelpet commented Nov 6, 2022

Makes sense

/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Nov 6, 2022
@k8s-ci-robot k8s-ci-robot merged commit f982934 into kubernetes:master Nov 6, 2022
@k8s-ci-robot k8s-ci-robot added this to the v1.26 milestone Nov 6, 2022
@johngmyers johngmyers deleted the delete-clb branch November 6, 2022 18:22
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. area/provider/aws Issues or PRs related to aws provider 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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants