To manage costs in GKE, you must plan, continuously monitor, and optimize your environment. This section describes how you can manage the GKE costs that are associated with the blueprint.
Proactive costs planning
To plan your costs proactively, you must set clear cost expectations for your GKE workloads. Requirements can include many factors, such as the number and type of VMs used, the level of network traffic, the rate of logging, and the frequency of builds. After you set your cost expectations, you can set budget alerts on your projects, as described in the enterprise foundation blueprint.
To attribute costs between workloads, you must consider how different resource types have different granularities of cost attribution. For example, consider the following:
- Project costs: Some projects contain resources that are associated with a single tenant. The cost of a single project is attributed to a cost center using metadata labels in billing exports.
- Multi-tenant cluster costs: Some projects contain GKE clusters that are shared by multiple tenants. GKE cost allocation provides a granular breakdown of costs in billing exports for each namespace or label on Kubernetes resources.
- Shared costs: Some projects include shared resources that support many tenants, but billing reports can't granularly attribute usage to individual tenants. We recommend that you treat these as a shared cost of the developer platform. Depending on your internal processes for cost attribution, you might assign this to a shared IT cost center or split the cost proportionally among cost centers based on the number of workloads that use the platform.
The following shows which projects are associated with which type of cost attribution.
Project |
Description |
Types of charges |
---|---|---|
|
Automation workflow project |
Shared costs |
|
Application factory project |
Shared costs |
|
Virtual machines and persistent disks for GKE |
Multi-tenant cluster costs |
Network load balancer and traffic charges incurred by applications on GKE |
Shared costs |
|
Logging and monitoring |
Shared costs |
|
|
CI/CD and application-owned resources, such as AlloyDB for PostgreSQL |
Project costs |
Continuous resource monitoring
After you set a cost baseline for your GKE clusters, use Cloud Monitoring to monitor the use of your GKE clusters and look for underutilized resources as areas for potential optimization. In this blueprint, all costs are billed to a centralized billing account. To export your costs and do detailed analysis of your GKE billing usage, you can use Cloud Billing BigQuery exports, as described in the enterprise foundation blueprint.
Optimization techniques
After you create an operating baseline for your applications, you can apply different optimization techniques to the environment. These optimization techniques are designed to help reduce your costs.
What's next
- Read about deployment methodology (next document in this series).