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

Add OpenShift cleaner script #35

Merged
merged 1 commit into from
Mar 27, 2024
Merged

Add OpenShift cleaner script #35

merged 1 commit into from
Mar 27, 2024

Conversation

atodorov
Copy link
Collaborator

No description provided.

@atodorov
Copy link
Collaborator Author

Example of running this script locally:

WARNING: Using insecure TLS client config. Setting this option is not supported!

Logged into "https://api.ocp-virt.prod.psi.redhat.com:6443" as "system:serviceaccount:image-builder:gitab-ci" using the token provided.

You have access to the following projects and can switch between them with 'oc project <projectname>':

    cnv-qe
  * image-builder
    openshift-virtualization-os-images

Using project "image-builder".

'ATTENTION: Feb 6 2023, the my_ldap_provider will no longer be available
as a login option. Please see the "[PSI Openshift] Important Authentication Update"
email for details.'
system:serviceaccount:image-builder:gitab-ci
Already on project "image-builder" on server "https://api.ocp-virt.prod.psi.redhat.com:6443".
virtualmachine.kubevirt.io "image-builder-vm-rhel-8-10-x86-64-main-6311253374" deleted
The VM 'image-builder-vm-rhel-8-10-x86-64-main-6311253374' was terminated
persistentvolumeclaim "image-builder-data-volume-rhel-8-10-x86-64-main-6311253374" deleted
The PVC 'image-builder-data-volume-rhel-8-10-x86-64-main-6311253374' was terminated
persistentvolumeclaim "image-builder-data-volume-rhel-8-10-x86-64-pr-4032-6449247316" deleted
The PVC 'image-builder-data-volume-rhel-8-10-x86-64-pr-4032-6449247316' was terminated
persistentvolumeclaim "image-builder-data-volume-rhel-8-10-x86-64-pr-4032-6449247316-scratch" deleted
The PVC 'image-builder-data-volume-rhel-8-10-x86-64-pr-4032-6449247316-scratch' was terminated
persistentvolumeclaim "image-builder-data-volume-rhel-8-10-x86-64-pr-4032-6450318042" deleted
The PVC 'image-builder-data-volume-rhel-8-10-x86-64-pr-4032-6450318042' was terminated

@atodorov atodorov marked this pull request as ready for review March 25, 2024 10:51
openshift.sh Show resolved Hide resolved
@atodorov
Copy link
Collaborator Author

The PVC 'image-builder-data-volume-rhel-8-10-x86-64-main-6311253374' was terminated
persistentvolumeclaim "image-builder-data-volume-rhel-8-10-x86-64-pr-4032-6449247316" deleted

Hmmm, even though this is supposed to be removed I can still see the PVC in the OpenShift UI.

image

executing the removal script again this time tells me that this PVC was created recently and will not be removed:

PVC 'image-builder-data-volume-rhel-8-10-x86-64-pr-4032-6449247316' was created less than 6 hours ago

Not quite sure what's going on here.

@jrusz
Copy link
Contributor

jrusz commented Mar 25, 2024

The PVC 'image-builder-data-volume-rhel-8-10-x86-64-main-6311253374' was terminated
persistentvolumeclaim "image-builder-data-volume-rhel-8-10-x86-64-pr-4032-6449247316" deleted

Hmmm, even though this is supposed to be removed I can still see the PVC in the OpenShift UI.

image

executing the removal script again this time tells me that this PVC was created recently and will not be removed:

PVC 'image-builder-data-volume-rhel-8-10-x86-64-pr-4032-6449247316' was created less than 6 hours ago

Not quite sure what's going on here.

Hm, that's strange. Can you delete it manually? I think that once you delete the VM you should be able to delete the PVC... Maybe a slight delay would be required between the two?

jrusz
jrusz previously approved these changes Mar 25, 2024
Copy link
Contributor

@jrusz jrusz left a comment

Choose a reason for hiding this comment

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

LGTM, just one question and I'm not sure what's up with that PVC, seems more investigation is required.

openshift.sh Show resolved Hide resolved
@atodorov
Copy link
Collaborator Author

FTR I am having issues deleting some of the PVCs, created RITM1742240 ticket to ask for help.

@atodorov
Copy link
Collaborator Author

FTR I am having issues deleting some of the PVCs, created RITM1742240 ticket to ask for help.

@jrusz I got my ticket resolved but didn't actually get a good technical explanation as to how the problem happened in the first place. Let's merge this script and monitor how the cleaner job runs in the next few days. WDYT ?

@jrusz
Copy link
Contributor

jrusz commented Mar 27, 2024

FTR I am having issues deleting some of the PVCs, created RITM1742240 ticket to ask for help.

@jrusz I got my ticket resolved but didn't actually get a good technical explanation as to how the problem happened in the first place. Let's merge this script and monitor how the cleaner job runs in the next few days. WDYT ?

Sounds good, so it works as expected now?

@jrusz jrusz merged commit 80de615 into main Mar 27, 2024
2 checks passed
@jrusz jrusz deleted the openshift_cleaner branch March 27, 2024 15:12
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.

None yet

2 participants