Azure Rate Card Configuration
Kubecost needs access to the Microsoft Azure Billing Rate Card API to access accurate pricing data for your Kubernetes resources.
You can also get this functionality plus external costs by completing the full Azure billing integration.
Creating a custom Azure role
Start by creating an Azure role definition. Below is an example definition, replace YOUR_SUBSCRIPTION_ID
with the Subscription ID where your Kubernetes cluster lives:
Save this into a file called myrole.json.
Next, you'll want to register that role with Azure:
Creating an Azure service principal
Next, create an Azure service principal.
Keep this information which is used in the service-key.json below.
Supplying Azure service principal details to Kubecost
Option 1: Via a Kubernetes Secret (Recommended)
Create a file called service-key.json and update it with the Service Principal details from the above steps:
Next, create a Secret for the Azure Service Principal
When managing the service account key as a Kubernetes Secret, the secret must reference the service account key JSON file, and that file must be named service-key.json
.
Finally, set the kubecostProductConfigs.serviceKeySecretName
Helm value to the name of the Kubernetes secret you created. We use the value azure-service-key
in our examples.
Option 2: Via Helm values
In the Helm values file:
Or at the command line:
Azure billing region, offer durable ID, and currency
Kubecost supports querying the Azure APIs for cost data based on the region, offer durable ID, and currency defined in your Microsoft Azure offer.
Those properties are configured with the following Helm values:
kubecostProductConfigs.azureBillingRegion
kubecostProductConfigs.azureOfferDurableID
kubecostProductConfigs.currencyCode
Be sure to verify your billing information with Microsoft and update the above Helm values to reflect your bill to country, subscription offer durable ID/number, and currency.
See also
The following Microsoft documents are a helpful reference:
Last updated