Committed Use Discount
Cloud service provider relevance: GKE.
Ocean clusters help you optimize using committed use discounts (CUDs) to ensure minimal waste. Ocean strategically allocates reservations for maximum benefit, improving estimation accuracy for commitment usage. This provides visibility into savings plans and reserved instance utilization, enabling enhanced methods for effectively utilizing vacant plans and maximizing cost savings.
You can use your existing committed-use discounts before adding extra resources. This lets you make efficient use of your cloud resources.
The utilize commitment plans feature lets you leverage spend- and resource-based CUDs in your Ocean clusters before adding additional resources. Ensure the prerequisites are in place for the method you want to use.
Ocean manages the committed use discount virtual machines by automatically:
-
Scale up: Ocean uses the commitment utilization status to decide when to scale up on-demand virtual machines instead of spot instances. This helps utilize commitment plans in markets they apply to.
-
Scale down: Instances that use commitment plans are given priority during the scale-down process, ensuring the commitment plan strategy is maintained.
-
Revert to reserved: Ocean maintains the group’s strategy to utilize commitment plans. This is done by checking if there are spot instances in the group that can be replaced with on-demand instances that utilize commitment plans.
You can utilize your GCP committed use discounts in Ocean for:
- Resource-based and spend-based commitment Utilization
- Spend-based commitments
- Resource-based commitment with a billing account
Resource based and Spend-based Commitment Utilization
-
On the View by Principals tab, click the Security Insights of a principal that begins with
spotinst-role-act-
. -
In the Spot policy, ensure the compute.commitments.list permission for Spot’s generated service account is listed.
Spend based Commitment Utilization Only
Connect all your GCP projects to Spot accounts, with one account assigned to each project:
-
For projects not managed by Spot, create a Spot account with read-only permissions (required for calculating the commitment plans utilization status).
The required permission for read-only accounts is
compute.instances.list
on Spot's generated service accounts. -
In the GCP console, search for API Library.
-
In the API Library, search for and select Cloud Commerce Consumer Procurement API.
-
In Cloud Commerce Consumer Procurement API, click Enable.
-
Return to the search bar and search for and select Cloud Billing API.
-
In Cloud Billing API, click Enable.
-
In the GCP console, click Billing > Account Management > Add Principal.
-
In New principals, enter the Service Account Names.
-
Add the Consumer Procurement Order Viewer role to all the Spot service account permissions in your billing account that is linked to all the Spot service accounts that you found.
-
Click Save.
Resource Based Commitment with a Billing Account
A resource-based commitment with a billing account scope enables you to use the same CUD in multiple projects, as mentioned in GCP. Connect all of your GCP projects to Spot accounts, with one account assigned to each project, similar to Spend-Based Commitments.
For projects that Spot does not manage, a Spot account with read-only permissions should be created to calculate the status of the commitment plan usage: compute.instances.list
on Spot's generated service accounts.
The compute.instances.list
permission for the project that purchased the CUD.
Enable CUD Utilization
-
For Ocean clusters in the Spot console:
- In the Spot console, go to Ocean > Cloud Clusters.
- Click Create Cluster.
- Follow the instructions for creating a cluster.
- Select Utilize CUDs on the Compute tab > Additional Configurations.
-
For Ocean clusters in the API, make sure shouldUtilizeCommitments is true:
View code
"strategy": {
"shouldUtilizeCommitments": true
},