OpenCost automatically reads node information from
node.spec.providerID to determine the cloud service provider (CSP) in use. If it detects the provider is GCP, it attempts to pull data for node pricing. To read node information, OpenCost uses the GCP Cloud Billing API, which requires an API key.
GCP pricing configuration
To use OpenCost to get pricing information from your GCP project:
Enable the Cloud Billing API.
Generate an API key that has permissions to access.
Enable Cloud Billing API
To enable the Cloud Billing API:
Click the Enable the API button.
Follow the prompts in Get Google Cloud pricing information.
Generate API key
Generate an API key to use in place of the default key in the
CLOUD_PROVIDER_API_KEY environment variable.
Create an API key by following the steps in Authenticate using API keys.
Optionally, edit the key and restrict the key to the Cloud Billing API.