# How clusters are priced

> Where each cluster's cost comes from on AWS, Google Cloud and Azure, and how to price a cluster that has no cloud bill.

Source: https://docs.levelfour.ai/connectors/kubernetes/pricing


LevelFour prices every node from your own bill, never from a list price. It then splits each node's cost across the containers that ran on it, by what each requested or used. The capacity no container requested is the node's idle cost.

| Where the cluster runs   | Priced from                                                                                                | What LevelFour needs                                                                         |
| ------------------------ | ---------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------- |
| Amazon EKS               | The Cost and Usage Report, amortized, per EC2 instance                                                     | The AWS account connected, with [detailed cost data](/connectors/aws/detailed-cost-data)     |
| Google Kubernetes Engine | The Cloud Billing detailed export, net of committed and sustained use credits, per Compute Engine instance | The project connected, with the [Detailed usage cost export](/connectors/gcp/billing-export) |
| Azure Kubernetes Service | The Azure cost export, amortized, per virtual machine scale set                                            | The subscription connected, with [billing data](/connectors/azure/billing-data)              |
| Anywhere else            | The hourly prices you set                                                                                  | [Node prices](#price-a-cluster-with-no-cloud-bill) on the cluster's **Nodes** tab            |

The agent tells the clouds apart by each node's provider ID. A node whose provider ID names none of the three clouds belongs to a cluster with no cloud bill.

A day the bill has not covered yet reads as not yet priced, and fills in when the bill arrives.

## Purchase options

On AWS, LevelFour reads each instance's purchase option from the bill: On-Demand, Spot, Reserved Instance or Savings Plan. On Google Cloud, LevelFour tells Spot and preemptible instances apart by their SKU in the export. On Azure, a node is Spot when its `kubernetes.azure.com/priority` label, or the older `kubernetes.azure.com/scalesetpriority` label, says `spot`, and On-Demand otherwise ([AKS node labels](https://learn.microsoft.com/en-us/azure/aks/use-labels)).

## Google Kubernetes Engine

Each GKE node is a Compute Engine instance with its own rows in the [detailed export](https://docs.cloud.google.com/billing/docs/how-to/export-data-bigquery-tables/detailed-usage), credits included, so LevelFour reads that instance's compute cost for the day.

The Standard usage cost export has no per-resource rows, so a GKE cluster on it shows usage without prices.

## Azure Kubernetes Service

Azure bills a node pool's virtual machine scale set as one resource ([Azure VM usage](https://learn.microsoft.com/en-us/azure/virtual-machines/vm-usage)). Each node gets the scale set's cost for the day in proportion to the hours it ran.

## Price a cluster with no cloud bill

A cluster on bare metal, in your own data center, or on a distribution whose nodes report no cloud provider ID has no bill for LevelFour to read. Set an hourly price for its nodes, and LevelFour prices the cluster from it.

### Open the cluster's Nodes tab

Open **Kubernetes**, pick the cluster, and open the **Nodes** tab. The **Node prices** card appears on a cluster with no cloud bill, once its agent has reported.

### Set the prices

Price nodes one at a time by name, or many at once by a label they carry, such as `node.kubernetes.io/instance-type=metal-large`. Each price is in US dollars an hour. A list holds up to 500 prices.

A node's own price wins. Otherwise the first label price in the list that matches the node applies, so put the most specific labels first.

### Wait for the next rollup

Prices apply within about 12 hours, to the last three days and every day after. Days further back keep the price they had. Clearing the list leaves the cluster's nodes unpriced from then on.

Setting node prices takes the **Admin** role.

## Clusters without the agent

A cluster that does not run the agent can still show cost per namespace when its bill carries the split itself. [Clusters without the agent](/connectors/kubernetes/without-the-agent) covers EKS split cost allocation and GKE cost allocation.
