IBM & Red Hat on AWS
Monitor and Optimize HAQM EKS Costs with IBM Instana and Kubecost
As enterprises scale their Kubernetes workloads on HAQM Elastic Kubernetes Service (HAQM 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 HAQM 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 HAQM EKS to gain better cost allocation insights and optimize your Kubernetes infrastructure spending.
Optimizing Cost and Performance on HAQM EKS
As your Kubernetes environments grow on HAQM 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 HAQM 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 HAQM 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. HAQM EKS cost categories as monitored by Kubecost.
Kubecost organizes HAQM EKS costs into three main categories as illustrated in the previous architecture diagram:
- In-cluster costs: These include compute resources consumed within your HAQM 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 HAQM Simple Storage Service (HAQM 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 HAQM Relational Database Service (HAQM 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 HAQM EKS), IBM Instana, and Kubecost.
- Access to an AWS account with permissions to create the resources described in the Walkthrough
- An active HAQM EKS cluster. For instructions on creating an HAQM EKS cluster, see Create an HAQM EKS cluster.
- You must have the HAQM 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 HAQM EKS clusters.
- Kubecost needs to be installed (as shown on the first step in the Walkthrough section) on the same HAQM 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 HAQM EKS and related AWS services. You’ll incur charges for HAQM EKS clusters, HAQM Elastic Compute Cloud (HAQM EC2), and any additional services like HAQM S3 or HAQM RDS that your applications use.
For detailed pricing information, see HAQM EKS pricing, HAQM 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 HAQM EKS cluster:
- Create an IAM service account to use the HAQM 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/HAQMEBSCSIDriverPolicy \
--approve \
--role-only \
--role-name HAQMEKS_EBS_CSI_DriverRole
$ export SERVICE_ACCOUNT_ROLE_ARN=$(aws iam get-role --role-name HAQMEKS_EBS_CSI_DriverRole --output json | jq -r '.Role.Arn')
- Install the HAQM 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 http://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 HAQM Cognito with ALB, as detailed in the AWS blog Authenticate Kubecost Users with Application Load Balancer and HAQM Cognito.
For comprehensive security guidance in production environments, refer to the HAQM 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 HAQM EKS integration overview, showing the main dashboard with cost allocation metrics.
- If you need to update an existing Kubecost installation:
$ helm repo add kubecost http://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 HAQM EKS cluster will appear, displaying real-time cost tracking and detailed namespace-level breakdowns, as shown in Figure 3.

Figure 3. Cost Information on HAQM 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 HAQM EKS cluster, and choose Kubecost metrics in the Kubernetes > Cost tab. The following Instana dashboard screenshot (Figure 4) illustrates cost monitoring for an HAQM EKS cluster.

Figure 4. HAQM EKS cluster total and idle cost graphic showing cost fluctuations over a seven-day period.
Figure 5 presents namespace-level cost tracking for your HAQM 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. HAQM EKS cluster cost breakdown by Namespace.
Lastly, Figure 6 shows your HAQM 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. HAQM 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 HAQM 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 HAQM 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 HAQMEKS_EBS_CSI_DriverRole
- Optional. If you created a dedicated HAQM 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 HAQM S3 buckets, HAQM Elastic File System (HAQM EFS) file systems, or HAQM RDS instances, remove them as needed using the AWS Management Console or AWS CLI.
Summary
By integrating IBM Instana and Kubecost on HAQM 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 HAQM 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 HAQM Cognito
- Monitoring HAQM 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 HAQM 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