CostLensKubernetes Setup & Prerequisites

Kubernetes Setup & Prerequisites

Everything you need to enable — per cloud — to get full Kubernetes data on the CostLens Kubernetes dashboard, from cluster visibility down to per-namespace and per-workload cost, across Amazon EKS, Azure AKS, and Google GKE.

Updated September 20265 min read

The CostLens Kubernetes dashboard builds up in layers: connect an account and you immediately see your clusters; enable a cost-allocation signal and you get cost per cluster, then per namespace, then per workload. This page lists exactly what to enable for each layer, per cloud.

Install-nothing, works on private clusters

CostLens reads Kubernetes data entirely from your cloud's own billing and management APIs — the same read-only access you granted when connecting the account. There is no agent to install in the cluster and no Kubernetes API access required.

The layers

LayerWhat appears on the dashboardWhat it needs
1. Cluster visibilityCluster name, region, version, statusThe base account connection (read-only roles)
2. Node costPer-cluster node compute costA cost-allocation tag / label
3. Namespace costThe Top namespaces table + trendNamespace-level cost allocation
4. Workload costThe per-namespace workload drill-downWorkload / controller allocation
5. OptimizationIdle / right-size / Spot + pod-rightsizing findingsMetrics access (a paid add-on for pod rightsizing on EKS/AKS)

Cost-allocation signals are not retroactive

Every cost-allocation tag or label you enable below takes ~24–48 hours to populate and only covers usage from the moment you enable it — the cloud never back-fills the past. CostLens also caches the billing lookups for about 6 hours. So after enabling anything here, wait a day, then trigger a Sync on the account.

Amazon EKS

Connect the account (cluster visibility + optimization)

Connect the AWS account with the standard CostLens IAM role — ReadOnlyAccess already covers EKS List*/Describe*, CloudWatch, and Cost Explorer — and enable an AWS Resource Explorer aggregator index so the cluster appears in inventory. This alone gives cluster visibility and the node-pool optimization checks (idle / right-size / Spot).

Node cost — activate the cluster tag

In AWS Billing → Cost allocation tags, activate the AWS-generated aws:eks:cluster-name tag. AWS then tags the cluster's node compute (EC2 / EBS / networking) so CostLens can total it per cluster.

Namespace cost — enable Split Cost Allocation Data

In AWS Cost Management → Cost allocation, enable Split Cost Allocation Data for Amazon EKS, then activate the aws:eks:namespace cost-allocation tag.

Workload cost — activate the workload tag

Activate the aws:eks:workload-name cost-allocation tag (part of Split Cost Allocation Data) to unlock the per-workload drill-down.

Pod-request rightsizing (optional)

Enable CloudWatch Container Insights on the cluster. This is a paid AWS add-on that CostLens will never turn on for you — enable it only if you want pod-request rightsizing recommendations.

Azure AKS

Connect the account (cluster visibility + optimization)

Connect the subscription with Reader (Azure Resource Graph + Azure Monitor metrics + VM Scale Set enumeration) and Cost Management Reader at the subscription or management-group scope. This gives cluster visibility and the node-pool optimization checks.

Node cost — automatic

AKS node compute lives in the cluster's node resource group (MC_<resource-group>_<cluster>_<region>). CostLens attributes that resource group's spend to the cluster automatically using the Cost Management read access above — no tag to activate.

Namespace & workload cost — enable the cost analysis add-on

Enable the AKS cost analysis add-on on the cluster. Azure Cost Management then allocates the cluster's spend by Kubernetes namespace and controller, powering both the namespace table and the workload drill-down.

Pod-request rightsizing (optional)

Enable Azure Monitor for containers (Container Insights) with a Log Analytics workspace. This is a paid add-on — enable it only if you want pod-request rightsizing recommendations on AKS.

Google GKE

Connect the account (cluster visibility + optimization)

Connect the project with BigQuery Data Viewer on the billing-export dataset, roles/cloudasset.viewer (inventory), and — for the optimization checks — roles/compute.viewer and roles/monitoring.viewer. This gives cluster visibility, the node-pool checks, and pod-request rightsizing (GKE exposes both usage and requests via Cloud Monitoring, so no extra add-on is needed).

Node, namespace & workload cost — enable GKE cost allocation

Make sure your detailed billing export to BigQuery is on, then turn on GKE cost allocation on the cluster. Google writes the goog-k8s-cluster-name, goog-k8s-namespace, and goog-k8s-controller-name labels into the export — a single switch that unlocks node, namespace, and workload cost.

Requirements at a glance

To see…AWS (EKS)Azure (AKS)Google (GKE)
ClustersReadOnlyAccess + Resource ExplorerReader + Cost Management Readercloudasset.viewer + BigQuery Data Viewer
Node costaws:eks:cluster-name tagAutomatic (node resource group)GKE cost allocation
Namespace costSplit Cost Allocation + aws:eks:namespaceAKS cost analysis add-onGKE cost allocation
Workload costaws:eks:workload-name tagAKS cost analysis add-onGKE cost allocation
Pod rightsizingCloudWatch Container Insights (paid)Azure Monitor for containers (paid)Built in (monitoring.viewer)

After enabling — verify

Wait ~24–48 hours

Cost-allocation tags and labels are forward-only and take a day or two to start emitting data.

Trigger a Sync

Open the account in CostLens and click Sync (or wait for the 6-hourly refresh) so the cached billing lookups pick up the new data.

Check the dashboard

The Node cost column fills in, then the Top namespaces table appears, with the per-workload breakdown available when you expand a namespace row.

Small or new clusters look sparse — that's expected

A cluster running only default workloads on one or two nodes generates very little spend, so even once everything is enabled the numbers will be small and only the system namespaces will appear. That's normal, not a gap.

CostLens
Previous
Kubernetes Optimization
CostLens
Next
Cost Forecast