hmcts / auto-shutdown

1 stars 3 forks source link

aks-auto-shutdown

Config for Auto-Shutdown/Start of the AKS clusters

In the near future, all environments excluding Production will be automatically shutdown. This action is to reduce the unnecessary infrastructure costs while the environments are not in use.

Default cluster shutdown hours

20:00 to 06:30 everyday of the week.

Skip shutdown functionality

In the event that an environment or environments are needed outside of the default hours, you can raise an "issue" to automatically exclude it from the shutdown schedule.

Shutdown exclusion request - review process

All shutdown requests are now subject to an approval process, primarily based on the associated additional cost of running clusters for longer.

Any requests under an estimated value of £5,000 will be auto approved. Anything higher will require an approval from someone other than the requester.

It is important to monitor the comment section of the request (GitHub issue), the automated process will provide feedback in these comments including:

Who can approve requests?

Currently, anyone other than the requester can be an approver. The main purpose of this approval system is to sanity check that requests are not excessive.

What is the approval guidance?

Requests should only be approved when the shutdown exclusion is necessary and for the appropriate amount of time.

You should check:

Examples:

In this example, the shutdown start date should be 20-03-2024 with an end date of 20-03-2024. Tip: Leaving the end date blank will default the end date to the same as the start date.

How is an approval added?

A request can be approved by adding the "approved" label to the request.

approval

A request can be denied by adding the "denied" label to the request. This will automatically close the ticket.

Cancelling a shutdown or startup

If you have raised an issue to get an exclusion and this is no longer required, you can cancel it.

To cancel it, simply add the cancel label to the original issue.

A github action will run to remove the issue from the json so the original exclusion you raised will not proceed.

Testing changes to this repo

If you wish to test changes to the repo, create a pull request. An action will run to create a test issue for you and it will process that test issue.

The issue will be named for your PR e.g. PR-100.

The action will search for issues based on the title so do not change this or create another issue with the same name.

The issue may get closed but this is expected. The same issue will be reused on subsequent runs so you don't need to open a new one. You can manually reopen the test issue if you need to test a change that will close the issue.

You can update the action to test different scenarios such as having a longer skip period if you need to test very high cost skips.

Just update the values as appropriate