Create AutoStopping Rules for GCP

Updated 1 month ago by Archana Singh

Currently, this feature is in Beta. Once the feature is released to a general audience, it will be available for Harness Professional, Essentials, Trial, and Community Editions.

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.

Currently, only Kubernetes clusters are supported for GCP. For more information on how to create a connector for the Kubernetes cluster, see Create a Kubernetes Connector for AutoStopping Rules.

In this topic:

Before You Begin

Step 1: Add a Cloud Provider

Perform the following steps to link your GCP cloud account to Harness.

  1. In Cloud Costs, click New AutoStopping Rule.
  2. In AutoStopping Rules, select GCP. It is the cloud account in which your workloads are running that you want to manage using AutoStopping Rules.
  3. 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.
  4. 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.

  1. In Cloud Costs, in AutoStopping Rules, click New AutoStopping Rule.
  2. 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.
  3. 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.
  4. In Define your AutoStopping rule, in Name your Rule, enter a name for your rule. This is the name of your AutoStopping rule.
  5. 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.

Currently, only Kubernetes clusters are supported.
  1. Select Kubernetes Cluster and then click Add a cluster.
  2. 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.
  3. 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.

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 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.

  1. Click add dependency to add a dependency on any existing rule.
  2. Select the rule from the RULES drop-down list.
  3. 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.
  4. 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.

Next Step


Please Provide Feedback