Skip to content
This repository was archived by the owner on Jan 13, 2026. It is now read-only.

Add to Github actions the first Custodian rule check for unattached disks#4449

Merged
castelblanque merged 3 commits into
mainfrom
4402-custodian-rule-disks
Mar 16, 2022
Merged

Add to Github actions the first Custodian rule check for unattached disks#4449
castelblanque merged 3 commits into
mainfrom
4402-custodian-rule-disks

Conversation

@castelblanque
Copy link
Copy Markdown
Contributor

Description of the change

With this PR, a cronjob is set to check every day at 8AM that there no unattached disks in the GCloud project used for CI when releasing.

It makes use of the Custodian rule provided by Jorge Bianquetti, plus the use of the available Cloud Custodian Github action.

Benefits

No unused, unattached disks will live more than 1 day. This saves money from cloud infrastructure invoice.

Applicable issues

Additional information

A couple of secrets are created:

  • GOOGLE_CLOUD_PROJECT
  • GCLOUD_CUSTODIAN_KEY

Rafa Castelblanque added 3 commits March 16, 2022 11:45
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
Signed-off-by: Rafa Castelblanque <rcastelblanq@vmware.com>
@castelblanque
Copy link
Copy Markdown
Contributor Author

First run shows 81 disks removed! 🥳

2022-03-16 09:58:21,233: custodian.policy:INFO policy:remove-unattached-disks resource:gcp.disk region: count:81 time:0.54
2022-03-16 09:58:46,392: custodian.policy:INFO policy:remove-unattached-disks action:diskdelete resources:81 execution_time:25.16

@castelblanque castelblanque changed the title Add to Github actions the first Custodian rule check for unattached disks Add to Github action the first Custodian rule check for unattached disks Mar 16, 2022
@castelblanque castelblanque changed the title Add to Github action the first Custodian rule check for unattached disks Add to Github actions the first Custodian rule check for unattached disks Mar 16, 2022
Copy link
Copy Markdown
Contributor

@antgamdia antgamdia left a comment

Choose a reason for hiding this comment

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

Wow, thank you!! 81 disks we weren't aware of! Great tool!
And... our first github action!

@castelblanque
Copy link
Copy Markdown
Contributor Author

our first github action!

Yeah, it is really good news! 💃

@castelblanque castelblanque merged commit 4d22a21 into main Mar 16, 2022
@castelblanque castelblanque deleted the 4402-custodian-rule-disks branch March 16, 2022 12:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants