Create AutoStopping Rules for GCP
AutoStopping Rules make sure that your non-production resources run only when used, and never when idle. It also allows you to run your workloads on fully orchestrated spot instances without any worry of spot interruptions.
This topic describes how to create AutoStopping Rules for GCP.
In this topic:
- Before You Begin
- Step 1: Add a Cloud Provider
- Step 2: Add a New AutoStopping Rule
- Step 3: Setup Access
- Next Step
Before You Begin
- Create a GCP Connector for AutoStopping Rules
- Create a Kubernetes Connector for AutoStopping Rules
- AutoStopping Rules Overview
Step 1: Add a Cloud Provider
Perform the following steps to link your GCP cloud account to Harness.
- In Cloud Costs, click New AutoStopping Rule.
- In AutoStopping Rules, select GCP. It is the cloud account in which your workloads are running that you want to manage using AutoStopping Rules.
- If you have already linked your GCP account and want to use that account, then select the GCP account from the Connect to your GCP account drop-down list.
- If you have not added your cloud account, click Connect to your GCP account drop-down list and then click New Connector. For the detailed steps, see Create a GCP Connector for AutoStopping Rules.
Step 2: Add a New AutoStopping Rule
Perform the following steps to add a new GCP AutoStopping rule:
Step 1: Define an AutoStopping Rule
Perform the following steps to get started with AutoStopping Rule.
- In Cloud Costs, in AutoStopping Rules, click New AutoStopping Rule.
- In the cloud account type, select GCP. It is the cloud account in which your workloads are running that you want to manage using AutoStopping rules.
- Select your GCP account from the Connect to your GCP account drop-down list and click Next. If you have not added a GCP cloud account, see Create a GCP Connector for AutoStopping Rules.
- In Define your AutoStopping rule, in Name your Rule, enter a name for your rule. This is the name of your AutoStopping rule.
- In Idle time, enter the idle time in minutes. This is the time that the AutoStopping rule will wait before stopping the idle instances.
Step 2: Select the Resources to be Managed by the AutoStopping Rules
Select the cloud resources that you want to manage using this rule. AutoStopping Rule will monitor the selected resources and stop them when they are idle beyond the configured idle time.
- Select Kubernetes Cluster and then click Add a cluster.
- Select the Kubernetes cluster that you want to manage using the AutoStopping rules. If you wish to create a new connector for the Kubernetes cluster, see Create a Kubernetes Connector for AutoStopping Rules.
- Once you have finished selecting the Kubernetes cluster, click Add selected.
(Optional) Step 3: Set Up Advanced Configuration
In this step, you can configure the following settings:
Hide Progress Page
Toggle the button to enable or disable the instances warming up progress status. If you turn this ON, the progress status will not be displayed.
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 dependant on a database server, create two AutoStopping Rules managing both the servers. Add a dependency on the Rule managing the application server to be dependant 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 will be a delay of 5 seconds before warming up Rule 1.
- Once you're done with all the configurations, click Next.
Step 3: Setup Access
For more information on setting up access for Kubernetes clusters, see Setup Access.