Self-hosted & k3s

CostPilot supports Kubernetes clusters running on bare-metal servers, virtual machines you manage yourself, or any Kubernetes distribution not associated with a major cloud provider’s pricing API. This includes k3s, kubeadm, kind, Docker Desktop, Minikube, and similar distributions.

Because there is no pricing API to query for self-hosted infrastructure, CostPilot uses a fixed per-node hourly cost that you configure. This gives you full control over how infrastructure costs are modelled in CostPilot, and allows you to reflect your actual hardware and hosting spend accurately.

How self-hosted pricing works

When CostPilot cannot match a node’s instance type to a known cloud provider pattern, it falls back to the self-hosted pricing mode. In this mode, each node in the cluster is assigned a fixed hourly cost that you define.

Internally, CostPilot aliases unrecognised instance types and patterns such as k3s, local, or blank instance type fields to the self-hosted provider. The same pricing configuration applies regardless of the exact distribution in use.

Default fixed costs

Out of the box, if no custom rate has been configured, CostPilot applies a small default hourly rate to self-hosted nodes to ensure cost allocation still functions during initial setup and local development:

Usage contextDefault hourly rate
Local development / testing$0.05/hr per node
General self-hosted fallback$0.10/hr per node
Warning

These default rates are placeholders only. They do not represent your actual infrastructure cost. You should always configure a custom rate before interpreting cost data from a self-hosted cluster.

Setting a custom per-node rate

To configure the per-node hourly cost for a self-hosted cluster:

  1. Navigate to Settings → Clusters in the CostPilot dashboard
  2. Select the cluster you want to configure
  3. Open the Cost configuration panel
  4. Enter your per-node hourly rate in USD
  5. Save the configuration

The rate you enter should represent the all-in hourly cost per node, including:

  • Hardware amortisation (purchase price divided by expected lifetime)
  • Data centre or colocation fees, prorated per node
  • Power and cooling costs, if applicable
  • Network costs, if significant
  • Any management or maintenance overhead you wish to include

For VM-based self-hosted infrastructure (e.g. nodes running on your own hypervisor), use the effective hourly cost of each VM, including the hypervisor licence overhead if relevant.

Note

If your cluster has nodes with significantly different costs — for example, a mix of high-spec compute nodes and smaller edge nodes — consider splitting them into separate clusters in CostPilot so you can configure a different rate for each group.

Supported distributions

CostPilot’s agent is a standard Kubernetes workload and runs on any conformant Kubernetes distribution. The following distributions have been tested and are known to work:

DistributionNotes
k3sFully supported. Instance type label may be absent or set to k3s — CostPilot handles both.
kubeadmFully supported. Node labels depend on the underlying VM or bare-metal configuration.
kind (Kubernetes in Docker)Supported. Useful for local development and CI. Use the default $0.05/hr placeholder rate.
Docker DesktopSupported. Single-node cluster. Use the local development rate.
MinikubeSupported. Single-node cluster. Useful for testing CostPilot’s UI with a local data source.
MicroK8sSupported. Canonical’s lightweight Kubernetes distribution for Ubuntu.
RKE / RKE2Supported. Rancher Kubernetes Engine on your own infrastructure.
Talos LinuxSupported. CostPilot agent runs as a standard pod — no OS-level dependencies.

If your distribution is not listed here, CostPilot will still attempt to monitor it. As long as the agent can reach the Kubernetes API server and the required RBAC permissions are in place, metric collection will work regardless of the underlying distribution.

When to use self-hosted mode

Use self-hosted pricing mode when:

  • Your cluster runs on bare-metal servers you own or lease
  • You are running Kubernetes on VMs managed by your own hypervisor (Proxmox, VMware, etc.)
  • Your cloud provider is not natively supported by CostPilot
  • You are running a local development cluster (kind, Minikube, Docker Desktop) and want to test CostPilot’s cost allocation features with a nominal cost
  • You have a hybrid cluster with some self-managed nodes alongside cloud-managed ones

Limitations

Self-hosted mode has some inherent limitations compared to cloud provider integrations:

  • No automatic pricing. There is no pricing API to query. You must calculate and enter your own per-node cost, and update it manually when your infrastructure costs change.
  • Flat rate per cluster. CostPilot applies a single rate to all nodes in the cluster. If your nodes have different costs, the per-cluster rate will be an average or you will need to split into multiple clusters.
  • No spot or reserved pricing. Self-hosted infrastructure does not have the concept of spot or reserved pricing tiers. The configured rate is applied uniformly.
  • No idle cost attribution to cloud billing. On cloud providers, CostPilot can correlate idle costs with actual cloud spend. On self-hosted clusters, idle cost is calculated relative to your configured per-node rate only.
Note

For mixed environments — for example, an on-premises cluster supplemented by cloud burst nodes — CostPilot will apply cloud provider pricing to any nodes it can identify by instance type, and the configured self-hosted rate to any nodes it cannot identify. This gives a reasonable approximation of total cost even in heterogeneous environments.

Example: calculating a bare-metal node cost

Suppose you have a rack of servers with the following costs:

  • Server purchase price: £4,000, expected lifetime 4 years
  • Rack space and power: £100/month per server
  • Network: included in rack fee

Amortised hardware cost: £4,000 / (4 × 12 months) = £83.33/month

Total monthly cost per node: £83.33 + £100 = £183.33/month

Hourly rate: £183.33 / (30.44 days × 24 hours) = ~£0.251/hour

Convert to USD at the current exchange rate and enter this value in Settings → Clusters → Cost configuration. Update it whenever your hosting costs change.