Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Load balancers are not torn down after cluster deletion #26

Closed
d47853 opened this issue Jun 17, 2020 · 6 comments
Closed

Load balancers are not torn down after cluster deletion #26

d47853 opened this issue Jun 17, 2020 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@d47853
Copy link
Member

d47853 commented Jun 17, 2020

When the cluster is torn down as the stack is deleted, the load balancers and their target groups remain. This probably happens because the alb helm chart is torn down before the graphs have unregistered.

@d47853 d47853 added the bug Something isn't working label Jun 17, 2020
@m29827 m29827 self-assigned this Jun 17, 2020
@m29827
Copy link
Member

m29827 commented Jun 22, 2020

Uninstalling the gaffer Helm chart before destroying the cluster correctly deletes the application load-balancers and the associated target groups. Running cdk destroy after successfully uninstalls the alb Helm chart and destroys the remaining cluster components.

@ctas582
Copy link
Member

ctas582 commented Jun 22, 2020

Just trying to understand what is missing here - it sounds like the CDK construct that is used to deploy a Helm chart will correctly uninstall the chart when you run cdk destroy or delete the CloudFormation stack. So is the problem that the ALB chart is being uninstalled before the Gaffer chart is uninstalled? In which case a dependency link just needs adding.

@m29827
Copy link
Member

m29827 commented Jun 22, 2020

Thanks for the comment - Yes that's right, I think adding the dependency would fix it but maybe it's not straight forward to do that dynamically at runtime? If not then that would result in a change to the gaffer chart that coupled it to the AWS ALB ingress controller - at the moment the Kind deployment of this chart uses an Nginx implementation. Maybe there's a better way, I'm a Helm novice!

@d47853
Copy link
Member Author

d47853 commented Jun 23, 2020

So is the problem that the ALB chart is being uninstalled before the Gaffer chart is uninstalled?

Yes, though as @m29827 says the graphs are added dynamically by users via the REST API. At the moment all the graphs are deployed to the default namespace so it could be a case of uninstalling all helm releases in the default namespace before uninstalling the ingress controller. It might be possible to do this using a custom resource.

Though if not, then we should add a comment in the docs reminding administrators to uninstall all graphs before destroying the stack for this reason.

@ctas582
Copy link
Member

ctas582 commented Jun 23, 2020

Ahh I see - I incorrectly assumed that the project deployed 1 cluster per graph (not actually properly looked at the code :S). In which case everything would be deployed via a single CloudFormation stack, so you just need to add a DependsOn to the Gaffer Helm Chart that references the ALB Helm Chart.

As you are deploying multiple graphs, outside of CloudFormation, you will likely need to add a Custom Resource. That can be backed by a lambda function, which detects when it is being told to delete, and calls an API endpoint to destroy/uninstall all the deployed graphs.

In addition to ALBs, you will probably also find that EBS volumes are currently being left behind too.

m29827 added a commit to m29827/Kai that referenced this issue Jul 7, 2020
m29827 added a commit to m29827/Kai that referenced this issue Jul 7, 2020
m29827 added a commit to m29827/Kai that referenced this issue Jul 7, 2020
m29827 added a commit to m29827/Kai that referenced this issue Jul 7, 2020
m29827 added a commit to m29827/Kai that referenced this issue Jul 7, 2020
m29827 added a commit to m29827/Kai that referenced this issue Jul 7, 2020
m29827 added a commit to m29827/Kai that referenced this issue Jul 8, 2020
m29827 added a commit to m29827/Kai that referenced this issue Jul 10, 2020
m29827 added a commit to m29827/Kai that referenced this issue Jul 10, 2020
m29827 added a commit to m29827/Kai that referenced this issue Jul 23, 2020
…when-stack-deleted

Conflicts:
	lib/rest-api/kai-rest-api.ts
m29827 added a commit to m29827/Kai that referenced this issue Jul 23, 2020
m29827 added a commit to m29827/Kai that referenced this issue Jul 24, 2020
m29827 added a commit to m29827/Kai that referenced this issue Jul 24, 2020
d47853 added a commit to m29827/Kai that referenced this issue Aug 18, 2020
d47853 added a commit that referenced this issue Aug 18, 2020
…r deleted. (#39)

* gh-26 Remove application load-balancers and target groups when cluster deleted.

* gh-26 Removing *.pyc files and ignoring __pycache__ directory

* gh-26 Uninstall graphs is now asynchronous and uses the delete graph SQS queue to initiate deletion.

* gh-26 Code review comments: reverting changes to generated Accumulo passwords.

* gh-26 Uplifting cdk version

* gh-26 Correcting add_graph.py

* gh-26 Fixing bug caused by merging gh-35 changes.

Co-authored-by: d47853 <d47853@users.noreply.github.com>
@d47853
Copy link
Member Author

d47853 commented Aug 18, 2020

Merged into develop

@d47853 d47853 closed this as completed Aug 18, 2020
d47853 pushed a commit that referenced this issue Aug 27, 2020
* gh-26 Remove application load-balancers and target groups when cluster deleted.

* gh-26 Removing *.pyc files and ignoring __pycache__ directory

* gh-40 Remove EBS volumes when cluster deleted.

* gh-40 Remove EBS Volumes when graph uninstalled / deleted.

* gh-40 Remove volumes with kubectl instead of the aws-sdk
macenturalxl1 added a commit to macenturalxl1/Kai that referenced this issue Jan 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants