IBM & Red Hat on AWS
Monitor and Optimize Amazon EKS Costs with IBM Instana and Kubecost
As enterprises scale their Kubernetes workloads on Amazon Elastic Kubernetes Service (Amazon EKS), they need effective cost and performance optimization. IBM Instana Observability (Instana), a comprehensive observability platform, and IBM Kubecost, a cost-monitoring solution for Kubernetes, work together to provide real-time visibility into both performance and cost metrics.
The integration between IBM Instana and Kubecost brings cost and allocation metrics directly into your Instana dashboards. This unified view presents Kubernetes cost metrics for Amazon EKS alongside application performance data, helping you make informed optimization decisions.
In this blog post, you’ll learn how to integrate IBM Instana with Kubecost on Amazon EKS to gain better cost allocation insights and optimize your Kubernetes infrastructure spending.
Optimizing Cost and Performance on Amazon EKS
As your Kubernetes environments grow on Amazon EKS, visibility into both application performance and infrastructure costs becomes essential for effective resource management. The IBM Instana and Kubecost integration addresses this challenge by providing a unified observability solution that connects technical performance with financial impact.
With this integration, you can:
- Connect costs to deployments: Correlate resource utilization with specific deployments and application changes to understand how code or configuration updates influence your AWS investment.
- Make data-driven optimization decisions: View namespace-level cost breakdowns alongside performance metrics to discover resource optimization opportunities and improve efficiency.
- Stay informed with proactive notifications: Receive timely alerts about resource usage patterns, with direct links to the related performance data for faster decision-making.
For example, when a new deployment changes your resource utilization, you can immediately determine whether it’s supporting improved performance or presenting an opportunity for further optimization, helping you maintain an ideal balance between performance and cost-efficiency.
Reference Architecture
The Instana and Kubecost integration provides a technical framework for comprehensive cost visibility across your Amazon EKS environment. This implementation enables detailed cost allocation and performance correlation at multiple levels, giving you actionable insights into your container infrastructure spending.
The diagram below (Figure 1) illustrates Amazon EKS cost categories that Kubecost monitors, including in-cluster costs (CPU, memory, network), external costs, and shared costs. Understanding these categories helps you optimize cost management across your EKS clusters.

Figure 1. Amazon EKS cost categories as monitored by Kubecost.
Kubecost organizes Amazon EKS costs into three main categories as illustrated in the previous architecture diagram:
- In-cluster costs: These include compute resources consumed within your Amazon EKS cluster, such as CPU, memory, persistent storage, network traffic, and GPU resources.
- External costs: External costs: These represent dedicated resources outside the cluster that serve specific namespaces, including Amazon Simple Storage Service (Amazon S3) buckets, Application Load Balancers (ALB) or Network Load Balancers (NLB), and other AWS resources tied to individual namespaces.
- Shared costs: These capture resources that span multiple namespaces, like Amazon Relational Database Service (Amazon RDS) instances, shared networking components, and other multi-namespace infrastructure.
The Instana agent collects these cost metrics from Kubecost’s API and integrates them with performance data, creating a unified data model. This integration allows you to trace high-level cost trends to specific performance metrics, helping you identify optimization opportunities across your entire Kubernetes infrastructure.
Prerequisites
Before you set up the Kubecost sensor in Instana, make sure you have:
- Familiarity with AWS (specifically Amazon EKS), IBM Instana, and Kubecost.
- Access to an AWS account with permissions to create the resources described in the Walkthrough
- An active Amazon EKS cluster. For instructions on creating an Amazon EKS cluster, see Create an Amazon EKS cluster.
- You must have the Amazon EBS CSI driver installed on your EKS cluster
- Helm client (version 3.1 or later), eksctl and kubectl installed on your bastion host for managing Kubernetes resources.
- Instana Agent deployed and configured in one or more Amazon EKS clusters.
- Kubecost needs to be installed (as shown on the first step in the Walkthrough section) on the same Amazon EKS cluster that the Instana agent is set up to monitor.
- Kubecost license and a Kubecost license key to collect usage metrics. For more information, see Adding a Product Key.
Costs
Implementing this solution involves costs for Amazon EKS and related AWS services. You’ll incur charges for Amazon EKS clusters, Amazon Elastic Compute Cloud (Amazon EC2), and any additional services like Amazon S3 or Amazon RDS that your applications use.
For detailed pricing information, see Amazon EKS pricing, Amazon EC2 pricing, and use the AWS Pricing Calculator to estimate your monthly costs. Additionally, you’ll need licenses for both IBM Instana and Kubecost, which have their own pricing structures.
Walkthrough
Install Kubecost using Helm
Follow these steps to install Kubecost in your Amazon EKS cluster:
- Create an IAM service account to use the Amazon EBS CSI Driver:
$ eksctl create iamserviceaccount \
--name ebs-csi-controller-sa \
--namespace kube-system \
--cluster $CLUSTER_NAME \
--attach-policy-arn arn:aws:iam::aws:policy/service-role/AmazonEBSCSIDriverPolicy \
--approve \
--role-only \
--role-name AmazonEKS_EBS_CSI_DriverRole
$ export SERVICE_ACCOUNT_ROLE_ARN=$(aws iam get-role --role-name AmazonEKS_EBS_CSI_DriverRole --output json | jq -r '.Role.Arn')
- Install the Amazon EBS CSI add-on:
$ eksctl create addon --name aws-ebs-csi-driver \
--cluster $CLUSTER_NAME \
--service-account-role-arn $SERVICE_ACCOUNT_ROLE_ARN --force
- Add the Kubecost Helm repository and install Kubecost:
$ helm install kubecost cost-analyzer \
--repo https://kubecost.github.io/cost-analyzer/ \
--namespace kubecost --create-namespace \
--set kubecostToken="<your-kubecost-token>"
Kubecost includes a User Interface (UI) that is not exposed by default. You can access this UI using various methods based on your environment’s requirements. The Kubecost Ingress Examples documentation offers multiple configuration options, including integration with the AWS Load Balancer (ALB) Controller.
In this walkthrough, we use port forwarding solely for demonstration purposes. This method is not secure and must not be used in production. In production environments, always use a properly configured Ingress URL with authentication and encryption to securely access the Kubecost UI—such as employing Amazon Cognito with ALB, as detailed in the AWS blog Authenticate Kubecost Users with Application Load Balancer and Amazon Cognito.
For comprehensive security guidance in production environments, refer to the Amazon EKS Best Practices for Security documentation.
- Enable port forwarding to access Kubecost UI:
$ kubectl port-forward --namespace kubecost deployment/kubecost-cost-analyzer 9090
- Verify the deployment by navigating the Kubecost UI at http://localhost 9090 in your web browser, as shown in Figure 2.

Figure 2. Kubecost and Amazon EKS integration overview, showing the main dashboard with cost allocation metrics.
- If you need to update an existing Kubecost installation:
$ helm repo add kubecost https://kubecost.github.io/cost-analyzer/ && \
helm repo update && \
helm upgrade kubecost kubecost/cost-analyzer -n kubecost
Update Cluster Name in Kubecost
- Next, open the Kubecost Analyzer deployment to update the cluster name:
$ kubectl edit deployment kubecost-cost-analyzer -n kubecost
- Find and update the CLUSTER_NAME environment variable with your actual cluster name:
- Save and exit the editor. Kubernetes automatically applies your changes to the deployment
Configure the Instana Kubecost Sensor
Choose one of the following options based on how you’ve deployed the Instana agent.
Option 1: Using Instana’s Agent configuration.yaml file.
- Locate and open the Instana Agent yaml file. For details on finding this file, see Configuring host agents using agent configuration file.
- Add the following configuration to enable the Kubecost Sensor:
agent:
configuration_yaml: |
com.instana.plugin.kubecost:
remote:
- url: 'http://kubecost-cost-analyzer.kubecost:9090'
poll_rate: 120 # seconds
clusters:
- 'demo-cluster1' # Replace with your EKS cluster name from Step 8
Note: The url should point to your Kubecost service. The default is typically http://kubecost-cost-analyzer.kubecost:9090 when installed in the Kubecost namespace.
- Save the file and restart the Instana Agent:
$ kubectl rollout restart deployment instana-agent -n instana-agent
- Navigate to your Instana URL, and sign in with your credentials. Once signed in, choose the Platforms option in the sidebar, select Kubernetes from the drop-down menu, and then choose the Cost The cost monitoring dashboard for your Amazon EKS cluster will appear, displaying real-time cost tracking and detailed namespace-level breakdowns, as shown in Figure 3.

Figure 3. Cost Information on Amazon EKS cluster in Instana, showing cluster-level cost metrics and resource utilization trends.
Option 2: Using Helm for Existing Instana Agent Installations
If you installed the Instana agent using Helm, follow these steps to update the configuration:
- Retrieve the current Helm values:
$ helm get values instana-agent -n instana-agent > current-values.yaml
- Edit current-values.yaml and add the Kubecost configuration under configuration_yaml:
agent:
configuration_yaml: |
com.instana.plugin.kubecost:
remote:
- url: 'http://kubecost-cost-analyzer.kubecost:9090' # Replace with your Kubecost service address
poll_rate: 120 # seconds
clusters:
- 'demo-cluster1' # Replace with your EKS cluster name from Step 8
Important: Be careful not to overwrite any existing configurations in this file. Add the Kubecost configuration to the existing YAML structure.
- Apply the updated Helm values to upgrade your Instana agent:
$ helm upgrade instana-agent instana-agent/instana-agent -n instana-agent -f current-values.yaml
- Verify the configuration was applied successfully and all pods are in Running state:
$ kubectl get pods -n instana-agent
Verify the Integration
- Check Instana Agent logs to confirm the Kubecost Sensor is enabled:
$ kubectl logs \$(kubectl get pods -n instana-agent -l app=instana-agent -o jsonpath='{.items[0].metadata.name}') -n instana-agent | grep -i kubecost
- You should see log entries indicating successful connection to the Kubecost API:
- Navigate to the Instana UI, choose your Amazon EKS cluster, and choose Kubecost metrics in the Kubernetes > Cost tab. The following Instana dashboard screenshot (Figure 4) illustrates cost monitoring for an Amazon EKS cluster.

Figure 4. Amazon EKS cluster total and idle cost graphic showing cost fluctuations over a seven-day period.
Figure 5 presents namespace-level cost tracking for your Amazon EKS cluster, showing how costs are distributed across different workloads over time. The color-coding helps you quickly identify which namespaces consume the most resources. This view is particularly useful when you need to attribute costs to specific teams or applications, or when investigating whether a particular namespace is consuming more resources than expected.

Figure 5. Amazon EKS cluster cost breakdown by Namespace.
Lastly, Figure 6 shows your Amazon EKS cluster’s resource utilization and costs broken down by namespace. The table displays CPU, memory, and storage usage alongside efficiency metrics and Total costs. Note the green trend percentages showing cost reductions across multiple namespaces. This detailed view helps you identify specific optimization opportunities within your Kubernetes environment.

Figure 6. Amazon EKS cluster infrastructure cost utilization.
Note: It may take 2 to 3 minutes for cost data to appear after configuring the integration.
Import considerations
- Ensure that the Kubecost service (http://kubecost-cost-analyzer.kubecost:9090 or your configured Kubecost service URL) is accessible from the Instana agent pods.
- Always back up your Helm values and YAML files before making changes.
- For monitoring multiple clusters, list all cluster names under the clusters field in the IBM Instana host agent configuration file:
- If cost data is not visible after 10 minutes, check the Instana agent logs for connections to the Kubecost API, as showin in the following example:
- Ensure that all Kubecost pods are in the Running state by checking their status with the following command:
$ kubectl get pods -n kubecost
Combining Performance Metrics with Cost Data
The integration demonstrated in this blog, connects performance metrics from IBM Instana with cost data from Kubecost, providing a unified view of your Amazon EKS clusters. This approach helps address two common challenges in Kubernetes management:
- Resource allocation decisions: You can now see exactly which namespaces, pods, and containers consume the most resources and their associated costs.
- Performance-cost correlation: When performance issues occur, you can immediately assess their financial impact, helping prioritize which issues to address first.
The combined dashboards provide cost visibility at the cluster, namespace, and application levels, helping you identify optimization opportunities while maintaining application performance.
Clean-up
When you’re finished with this walkthrough, follow these steps to remove the resources you created specifically for this integration:
- Uninstall Kubecost and its dependencies:
$ helm uninstall kubecost -n kubecost
$ kubectl delete namespace kubecost
- Delete the Instana Agent if no longer required:
$ helm uninstall instana-agent -n instana-agent && kubectl patch agent instana-agent -n instana-agent -p '{"metadata":{"finalizers":null}}' --type=merge && kubectl delete crd/agents.instana.io
$ kubectl delete namespace instana-agent
- Optional. Remove the Amazon EBS CSI Driver if not used by other applications:
$ eksctl delete addon --name aws-ebs-csi-driver \
--cluster $CLUSTER_NAME
$ aws iam delete-role --role-name AmazonEKS_EBS_CSI_DriverRole
- Optional. If you created a dedicated Amazon EKS cluster just for testing this integration, you can delete it:
$ eksctl delete cluster \
--name <your-eks-cluster-name> \
--region <your-aws-region>
If you created any resources specifically for this integration, such as Amazon S3 buckets, Amazon Elastic File System (Amazon EFS) file systems, or Amazon RDS instances, remove them as needed using the AWS Management Console or AWS CLI.
Summary
By integrating IBM Instana and Kubecost on Amazon EKS, you now have deeper insights into both application performance and cost optimization in a unified view. This integration helps you make data-driven decisions to improve resource efficiency and reduce your Kubernetes costs on AWS. The combined solution delivers several key benefits:
- Unified performance and cost visibility in a single pane of glass
- Detailed cost allocation by entity type (cluster, node, namespace, pod, container)
- Automated resource right-sizing recommendations
- Reduced resource wastage through intelligent monitoring
Start monitoring your Amazon EKS costs today to identify optimization opportunities and maximize the value of your cloud investment. You can begin with a free trial of IBM Instana from the AWS Marketplace.
Apptio – AWS Partner Spotlight
Apptio is a leading provider of cloud-based IT financial management software, helping CIOs and CFOs connect technology investments to business outcomes. Apptio’s purpose-built suite of applications uses business analytics to provide facts and insights about technology cost, value, and quality, so IT leaders can make faster, data-driven decisions.
Contact Apptio | Partner Overview | AWS Marketplace
Additional Content:
- Authenticate Kubecost Users with Application Load Balancer and Amazon Cognito
- Monitoring Amazon Bedrock Large Language Models with IBM Instana
- Automate Observability for AWS with IBM Instana self-hosted
- Realtime monitoring of microservices and cloud-native applications with IBM Instana SaaS on AWS
- Automatically Visualize and Monitor Applications on Amazon EKS with Instana
- What is IBM Instana
- Using IBM Instana for full stack observability on AWS
- AWS Partner IBM
Visit the AWS Marketplace for IBM Instana solutions available on AWS:
- AWS Marketplace: IBM Instana Observability
- AWS Marketplace: IBM Instana Observability PayPerUse
- AWS Marketplace: IBM Instana Observability Self-Hosted