Skip to content

podvm: Cleanup leftover packer resources for AWS #592

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
Apr 8, 2025

Conversation

bpradipt
Copy link
Contributor

@bpradipt bpradipt commented Mar 26, 2025

- Description of the problem which is fixed/What is the use case
During pod VM image build on AWS, if the job get's terminated abruptly then there will be left over packer resources.

- What I did
Added a cleanup script to execute as part of preStop hook for the image creation job to delete any leftover packer instances.

- How to verify it
Create kataconfig and watch for image creation job to start. Wait till it reaches the packer VM creation step. Delete the image creation pod and watch it's log to see the cleanup happening.

- Description for the changelog

Cleanup left over AWS packer resources

@openshift-ci openshift-ci bot requested review from littlejawa and snir911 March 26, 2025 15:06
@bpradipt bpradipt requested a review from beraldoleal March 26, 2025 15:32
@bpradipt bpradipt force-pushed the aws-packer-instances branch from 507babd to 55dc8c6 Compare March 26, 2025 17:09
The cleanup script gets the default VPC for the region and
then cleans up any left over packer instances.
The packer created instances have `packer` as prefix

Signed-off-by: Pradipta Banerjee <[email protected]>
@bpradipt bpradipt force-pushed the aws-packer-instances branch from 55dc8c6 to c772fea Compare March 27, 2025 11:33
@littlejawa
Copy link
Contributor

/retest

Copy link

openshift-ci bot commented Apr 2, 2025

@bpradipt: all tests passed!

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here.

Copy link

@ldoktor ldoktor left a comment

Choose a reason for hiding this comment

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

Functional-wise it works well. There is the question on how hard would be to add custom tags rather than rely on default VPC and packer* prefix, but we can probably get away with documenting this at this point. The bigger question is whether it's likely people will specify their own VPC when using this operator, in such case we should respect that in the cleanup.

Copy link

@ldoktor ldoktor left a comment

Choose a reason for hiding this comment

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

Functional-wise it works well. There is the question on how hard would be to add custom tags rather than rely on default VPC and packer* prefix, but we can probably get away with documenting this at this point. The bigger question is whether it's likely people will specify their own VPC when using this operator, in such case we should respect that in the cleanup.

Copy link

@ldoktor ldoktor left a comment

Choose a reason for hiding this comment

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

LGTM, provided we mention the default vpc packer* cleanup in docs. Tested with a few manually created vms without the operator and works well unless it hits some issues (like multiple VMs with the same SG, then it fails, which might be a good idea as our packer VMs should never do that)

@bpradipt bpradipt merged commit 372bebc into openshift:devel Apr 8, 2025
6 checks passed
@bpradipt bpradipt deleted the aws-packer-instances branch April 8, 2025 11:00
@bpradipt
Copy link
Contributor Author

bpradipt commented Apr 8, 2025

Added release note text in the related bug - https://issues.redhat.com/browse/KATA-3573

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants