AutoStopping Rules for GCP Instance Groups
Prerequisites
- You must provide the required permissions to Harness to create an instance in your GCP account.
- You must provide the required permissions to read the secrets and fetch the certificates stored in the secret for TLS-based flows.
- Ensure that you reserve some IPs if you intend to allocate elastic IP while creating an AutoStopping proxy.
Creating an AutoStopping Rule for RDS
- In Harness, navigate to Cloud Costs module -> AutoStopping Rules
- Click New AutoStopping Rule
- Select GCP as your cloud provider. Choose an existing GCP connector or click New Connector to create one.
After this, there are 3 simple steps to set up your AutoStopping rule:
- Step 1: Configuration
- Step 2: Setup Access
- Step 3: Review
- Enter a Name for your rule
- Set the Idle Time - how long an instance should be inactive before stopping
- In the Resources to be managed by the AutoStopping rules section, select "Instance groups".
- Click on + Add an Instance group. Add the instance group that you want to manage by this rule.
- Choose to convert the selected instance(s) to spot or remain on-demand.
- Set up Advanced Configuration:
- Hide Progress Page: This is especially useful when the service is invoked by an automation system, as it prevents misinterpretation of the progress page as the intended response from a service that is onboarded to AutoStopping.
- Dry-Run: Toggle the button if you wish to evaluate this feature without terminating your cloud resources. For more information, go to Evaluate AutoStopping rules in dry-run mode.
- Dependencies: Link your rule to other AutoStopping rules when resources depend on each other.
- Fixed Schedules: Create fixed schedules to automatically start or stop your instances at specific times.
Click to expand advanced configuration details
(Optional) Set up advanced configuration
In this step, you can configure the following settings:
Hide progress page
Toggle the button to disable the display of progress page during instances' warming up process. This option is especially useful when the service is invoked by an automation system, as it prevents misinterpretation of the progress page as the intended response from a service that is onboarded to AutoStopping. By hiding the progress page, the first response of warming up a rule after a downtime will be delayed until the intended service is up and running.
Dry Run
Toggle the button if you wish to evaluate this feature without terminating your cloud resources.
Add Dependency
Set dependencies between two or more AutoStopping Rules when you want one Rule to make one or more Rules to be active based on the traffic that it receives. For example for an application server dependent on a database server, create two AutoStopping Rules managing both the servers. Add a dependency on the Rule managing the application server to be dependent on the Rule managing the database server.
- Click add dependency to add a dependency on any existing rule.
- Select the rule from the RULES drop-down list.
- In DELAY IN SECS, enter the number of seconds that rule should wait after warming up the dependent rule. For example, you have Rule 1 dependent on Rule 2 and you have set 5 seconds delay. In that case, when the request is received to warm up Rule 1, then first Rule 2 (dependent rule) is warmed up, and then there is a delay of 5 seconds before warming up Rule 1.
- Once you're done with all the configurations, click Next.
Fixed Schedule
Create fixed uptime or downtime schedules for the resources managed by this AutoStopping Rule. When a resource is configured to go up or down on a fixed schedule, it is unaffected by activity or idleness during that time period.
In certain scenarios, you would not want your resources to go down or up. For example, every Friday at 5 p.m. you want your ABC
resource to go down. You can schedule downtime for your ABC
resource. During this window, the resource is forced to go down regardless of the defined rule. You can choose to specify uptime for your resources in the same way.
The fixed schedule takes precedence over the defined AutoStopping Rule.
Harness executes scheduled rules using Dkron, an open-source workload automation service.
To create a fixed schedule for your rule, do the following:
- In Fixed Schedules, click Add Fixed Schedule.
- In New Fixed Schedule, enter a Name for your schedule.
- In Type, select the type for your schedule. You can schedule an Uptime or Downtime for your rule. As per your schedule, the resources go up or down.
- Select the Time Zone from the drop-down list.
- In Set schedule period, use the date picker to set the start and end time for your schedule.
- In Begins on, select the start date and time for your schedule. You can select a date and specify the time.
- In Ends on, select the end date and time for your schedule. You can select a date and specify the time. Ensure that Never ends checkbox is unselected to set the end time.
- Select the checbox Never ends if you do not want to set end time for your schedule.
- You can also set a recurring schedule for the rule. If you want to set a recurring schedule, in Uptime/Downtime in the selected period, in Repeats, select the repeat frequency.
- Select which days of the week you'd like your schedule to repeat. You can choose any day between Sunday and Saturday.
- Select Everyday, to set the schedule for all seven days of the week.
- Set your repeat schedule's beginning and ending time. In the Time field, specify the start and end time for the fixed schedule.
- Select All Day, if you wish to set your schedule for the entire day. If you choose All Day for your schedule, you won't be able to choose a start and end time.
- In Setup Access, select Proxy from drop-down list or create a new one.
- Click on Next.
In Review, verify all the configuration details and click Save Rule. To edit any of the configuration settings, click EDIT and modify the settings.
Your AutoStopping rule is listed under the AutoStopping Rules dashboard.