Skip to main content
Boost your DevOps efficiency! Dive into our latest white paper.Read Now

Kubernetes Cost

Kubernetes Cost Monitoring with OpenCost in Kapstan

Kapstan uses OpenCost, an open-source tool, to help you monitor Kubernetes expenses. OpenCost provides detailed insights into how resources are being used, allowing you to improve efficiency and cut down on unnecessary spending. Key cost tracking areas include:

  • CPU Costs: Monitor compute resource usage and associated costs across pods and containers.
  • Memory Costs: Track RAM allocation and utilization costs for your workloads.
  • Storage Costs: Analyze persistent volume costs and storage class usage.
  • Efficiency Metrics: Identify resource waste and optimization opportunities using metrics like CPU/memory utilization versus requests.

Kapstan organizes these costs by service, helping teams make informed decisions about spending, resource adjustments, and overall cost savings

Kubernetes Cost


Dependencies for Kubernetes Cost Monitoring

Kapstan automatically configures the following dependencies to enable Kubernetes cost monitoring:

Core Components

  • Prometheus Stack: Kapstan installs kube-prometheus-stack with Prometheus server (50GB storage), Grafana, and required exporters for metrics collection.
  • OpenCost Operator: Pre-configured with cluster-specific settings.
  • Service Accounts and RBAC Permissions: Required for secure access and operations.

Cloud Provider Requirements

AWS(coming soon)

  • AWS Cloud Integration: Configured with the following permissions:
    • AWS Access Key and Secret Key with access to:
      • Spot Instance Data Feed
      • Reserved Instance Information
      • Savings Plans Data
      • Cost and Usage Reports

GCP

  • Billing API Access: Enabled for cost data collection.

Limitations

While Kapstan's Kubernetes cost monitoring provides valuable insights, it has the following limitations:

  1. Service Coverage:

    • Cost monitoring is available only for Container and Cron services deployed through the Kapstan platform.
  2. Helm Chart Deployment Limitations:

    • When deploying Public or Private Helm Charts through Kapstan, cost monitoring capabilities are restricted.
    • While primary resources deployed by the Helm chart are tracked, secondary resources created by operators or controllers within these charts are not included in cost calculations.
    • This limitation may affect the completeness of cost data for complex Helm-based deployments.

Best Practices for Effective Cost Monitoring

To maximize the value of Kapstan's cost monitoring capabilities, consider the following best practices:

  1. Regularly Review Efficiency Metrics: Use CPU and memory utilization versus requests to identify underutilized resources and rightsize workloads.

  2. Monitor Storage Costs: Regularly review storage utilization and adjust persistent volume sizes to match actual usage patterns and requirements.

  3. Leverage Cloud Provider Discounts: Use insights from AWS Reserved Instances, Spot Instances, and GCP committed use discounts to optimize spending.

  4. Plan for Helm Chart Complexity: For Helm-based deployments, manually track secondary resources to ensure comprehensive cost visibility.

Can't find what you need?