How To: Get Component Pricing for a Cluster

Prev Next

RealTheory can resolve the price of each component that makes up a Kubernetes cluster, including the managed Kubernetes service, load balancers, nodes, storage and network, using the current pricing published by the cloud provider. The prices are resolved against a rate card, so any discounts or fixed rates defined by the rate card are included in the results.

Overview

To get component pricing, submit a price sheet describing the components to price, along with the rate card to apply, to the K8sRates endpoint. The service looks up the price of each component, applies the rate card, and returns the completed price sheet.

Each cloud provider has its own price sheet method:

Cloud Provider Method Model
AWS POST <endpoint>/theory/api/v1/k8srates/awspricesheets AWS Price Sheet
Azure POST <endpoint>/theory/api/v1/k8srates/azurepricesheets Azure Price Sheet
GCP POST <endpoint>/theory/api/v1/k8srates/gcppricesheets GCP Price Sheet

The examples below use AWS. The Azure and GCP price sheets follow the same structure, but use attribute names specific to each provider; see the models above for details.

Get Component Pricing

To get the price of each component, call the method below on the K8sRates endpoint.

POST <endpoint>/theory/api/v1/k8srates/awspricesheets

where

  • {endpoint} - is the URL of the RealTheory SaaS portal for your account.

The body of the request is a price sheet describing the components to price:

  • kubernetes - the managed Kubernetes service, identified by region and sku (for example, Amazon EKS).
  • loadBalancer - the load balancer service, identified by region and sku (for example, Load Balancer-Application).
  • nodes - a list of nodes, each identified by region and instanceType. The following attributes are optional:
    • os - the operating system of the node. Defaults to linux if not specified.
    • billingModel - the billing model of the node. Supported values are OnDemand, Spot. Defaults to the billing model of the rate card if not specified.
  • storage - a list of storage types, each identified by region and sku (for example, gp3).
  • network - a list of network transfer types, each identified by region and sku (for example, Internet Outbound). For transfers between regions, the source and destination regions can be specified with the Source and Destination keys in the properties attribute.
  • rateCardId - the ID of the rate card to apply. If not specified, or if the rate card cannot be found, the built-in On-Demand rate card is applied.

Notes:

Example

POST theory/api/v1/k8srates/awspricesheets

with the following request body:

{
    "kubernetes": {
        "region": "us-east-1",
        "sku": "Amazon EKS"
    },
    "loadBalancer": {
        "region": "us-east-1",
        "sku": "Load Balancer-Application"
    },
    "nodes": [
        {
            "region": "us-east-1",
            "instanceType": "m5.large",
            "os": "linux"
        },
        {
            "region": "us-east-1",
            "instanceType": "t3.xlarge",
            "os": "linux"
        },
        {
            "region": "us-east-1",
            "instanceType": "trn1n.32xlarge",
            "os": "linux"
        }
    ],
    "storage": [
        {
            "region": "us-east-1",
            "sku": "gp3"
        },
        {
            "region": "us-east-1",
            "sku": "gp2"
        },
        {
            "region": "us-east-1",
            "sku": "standard"
        }
    ],
    "network": [
        {
            "region": "us-east-1",
            "sku": "IntraRegion"
        },
        {
            "region": "us-east-1",
            "sku": "InterRegion Inbound"
        },
        {
            "region": "us-east-1",
            "sku": "InterRegion Outbound"
        },
        {
            "region": "us-east-1",
            "sku": "Internet Inbound"
        },
        {
            "region": "us-east-1",
            "sku": "Internet Outbound"
        }
    ],
    "rateCardId": "2f6c1d8e-4b7a-4c39-9e51-7a0d3b2c8f14"
}

which returns the prices of the Amazon EKS service, an Application Load Balancer, three node types (including a GPU-accelerated node), three storage types and five network transfer types in the us-east-1 region, with the discounts from the Enterprise Agreement discount rate card applied.

Output

Returns the completed AWS price sheet:

{
    "kubernetes": {
        "sku": "Amazon EKS",
        "pricePerUnit": 0.1,
        "unit": "Hrs",
        "discount": 0.1,
        "region": "us-east-1",
        "currencyCode": "USD",
        "properties": {}
    },
    "loadBalancer": {
        "sku": "Load Balancer-Application",
        "servicePricePerUnit": 0.0225,
        "serviceUnit": "Hrs",
        "dataPricePerUnit": 0.008,
        "dataUnit": "GB",
        "discount": 0.1,
        "region": "us-east-1",
        "currencyCode": "USD",
        "properties": {}
    },
    "nodes": [
        {
            "instanceType": "m5.large",
            "os": "linux",
            "billingModel": "OnDemand",
            "nodePricePerUnit": 0.096,
            "nodeUnit": "Hrs",
            "cpuPricePerUnit": 0.031059,
            "cpuUnit": "Hrs",
            "memoryPricePerUnit": 0.004235,
            "memoryUnit": "GB",
            "gpuPricePerUnit": 0.0,
            "gpuUnit": "Hrs",
            "licenseSurcharge": 0.8,
            "licenseUnit": "Hrs",
            "discount": 0.22,
            "region": "us-east-1",
            "currencyCode": "USD",
            "properties": {}
        },
        {
            "instanceType": "t3.xlarge",
            "os": "linux",
            "billingModel": "OnDemand",
            "nodePricePerUnit": 0.1664,
            "nodeUnit": "Hrs",
            "cpuPricePerUnit": 0.026918,
            "cpuUnit": "Hrs",
            "memoryPricePerUnit": 0.003671,
            "memoryUnit": "GB",
            "gpuPricePerUnit": 0.0,
            "gpuUnit": "Hrs",
            "licenseSurcharge": 0.8,
            "licenseUnit": "Hrs",
            "discount": 0.22,
            "region": "us-east-1",
            "currencyCode": "USD",
            "properties": {}
        },
        {
            "instanceType": "trn1n.32xlarge",
            "os": "linux",
            "billingModel": "OnDemand",
            "nodePricePerUnit": 24.78,
            "nodeUnit": "Hrs",
            "cpuPricePerUnit": 0.031059,
            "cpuUnit": "Hrs",
            "memoryPricePerUnit": 0.004235,
            "memoryUnit": "GB",
            "gpuPricePerUnit": 1.16475,
            "gpuUnit": "Hrs",
            "licenseSurcharge": 0.8,
            "licenseUnit": "Hrs",
            "discount": 0.22,
            "region": "us-east-1",
            "currencyCode": "USD",
            "properties": {}
        }
    ],
    "storage": [
        {
            "sku": "gp3",
            "pricePerUnit": 0.00010959,
            "Unit": "GB",
            "discount": 0.15,
            "region": "us-east-1",
            "currencyCode": "USD",
            "properties": {}
        },
        {
            "sku": "gp2",
            "pricePerUnit": 0.00013699,
            "Unit": "GB",
            "discount": 0.15,
            "region": "us-east-1",
            "currencyCode": "USD",
            "properties": {}
        },
        {
            "sku": "standard",
            "pricePerUnit": 0.00006849,
            "Unit": "GB",
            "discount": 0.15,
            "region": "us-east-1",
            "currencyCode": "USD",
            "properties": {}
        }
    ],
    "network": [
        {
            "sku": "IntraRegion",
            "pricePerUnit": 0.01,
            "Unit": "GB",
            "discount": 0.05,
            "region": "us-east-1",
            "currencyCode": "USD",
            "properties": {}
        },
        {
            "sku": "InterRegion Inbound",
            "pricePerUnit": 0.0,
            "Unit": "GB",
            "discount": 0.05,
            "region": "us-east-1",
            "currencyCode": "USD",
            "properties": {}
        },
        {
            "sku": "InterRegion Outbound",
            "pricePerUnit": 0.02,
            "Unit": "GB",
            "discount": 0.05,
            "region": "us-east-1",
            "currencyCode": "USD",
            "properties": {}
        },
        {
            "sku": "Internet Inbound",
            "pricePerUnit": 0.0,
            "Unit": "GB",
            "discount": 0.05,
            "region": "us-east-1",
            "currencyCode": "USD",
            "properties": {}
        },
        {
            "sku": "Internet Outbound",
            "pricePerUnit": 0.09,
            "Unit": "GB",
            "discount": 0.05,
            "region": "us-east-1",
            "currencyCode": "USD",
            "properties": {}
        }
    ],
    "overhead": {
        "region": "",
        "pricePerUnit": 0.0,
        "unit": "Hrs",
        "discount": 0.0,
        "currencyCode": "USD",
        "properties": {}
    },
    "rateCardId": "2f6c1d8e-4b7a-4c39-9e51-7a0d3b2c8f14",
    "rateCardName": "Enterprise Agreement",
    "rateCardType": "DiscountRateCard"
}

where

  • pricePerUnit, servicePricePerUnit, dataPricePerUnit, nodePricePerUnit - are the prices published by the cloud provider for the billing model of the rate card, before any discount is applied.
  • cpuPricePerUnit, memoryPricePerUnit, gpuPricePerUnit - are the portions of the node price attributable to each CPU, GB of memory and GPU respectively. For example, the trn1n.32xlarge node above has 128 CPUs, 512 GB of memory and 16 GPUs, so 128 × 0.031059 + 512 × 0.004235 + 16 × 1.16475 ≈ 24.78, which matches its nodePricePerUnit.
  • licenseSurcharge - is the surcharge applied to offset the licensing costs associated with Windows nodes. It is returned for every node, but is only relevant to Windows nodes.
  • discount - is the discount from the rate card, expressed as a value between 0 and 1.0. To calculate the discounted price, multiply the price by 1 - discount. For example, the discounted price of the m5.large node above is 0.096 × (1 - 0.22) = 0.07488 per hour.
  • overhead - is the shared overhead associated with the cluster, which is only applicable to custom rate cards.
  • rateCardId, rateCardName, rateCardType - identify the rate card that was applied.

Notes:

  • Storage prices are returned per GB per hour, converted from the monthly price published by the cloud provider.
  • If a SKU rate card applies a FixedRate to a component, the fixed rate replaces the price published by the cloud provider, and the discount remains 0.
  • If the price of a node cannot be found, for example because the instance type is not offered in the specified region, the nodePricePerUnit is returned as 0, and the CPU, memory and GPU prices are set to default rates.