Cloudgov logo
Cloudgov logo
Cloudgov logo
Pricing About us

Recently added

By Category

Blog posts

Events

Podcasts

Download the Agentic AI FinOps Guide

Transform Your FinOps Strategy with Agentic AI

How Agentic AI Is Redefining FinOps for the Multicloud Era

How to Save Money on Amazon EKS Clusters with Extended Support Version Updates

Running Kubernetes clusters on Amazon EKS (Elastic Kubernetes Service) can be both powerful and cost-effective, but without proper management, costs can spiral out of control. AWS has introduced extended support for older Kubernetes versions on EKS, which has direct implications for cost management. Discover the cost implications of using extended support for Kubernetes versions in Amazon EKS. Learn how to reduce your Amazon EKS costs and explore EKS cost optimization best practices shared by our expert in this insightful blog. By leveraging this extended support and implementing effective strategies, you can optimize your expenses and keep your Kubernetes clusters running smoothly.

Cloudgov FinOps SME
Published on June 12, 2024

Share this post

Kubernetes clusters on Amazon EKS

Understanding the Cost Implications of Extended Support

AWS now offers extended support for older Kubernetes versions on Amazon EKS, allowing you to stay on a particular version longer while receiving critical updates and security patches. However, this extended support comes with additional costs. Therefore, it’s crucial to evaluate whether to upgrade to newer versions or leverage extended support based on your specific use case and workload requirements.

 

Key Points from AWS Extended Support for Kubernetes Versions:

  • Standard Support: $0.10 per cluster per hour.
  • Extended Support: Available for an additional fee, providing continued security updates and bug fixes for versions past their standard support window. Clusters running in this window will be charged a total of $0.60 per cluster per hour, effective from the April 2024 billing cycle (starting April 1, 2024).

For more details, you can read the AWS blog on EKS extended support pricing.

Example Cost Impact

Let’s assume you are running 50 EKS clusters: 25 using an older Kubernetes version that now requires extended support and 25 running Kubernetes versions in standard support. According to AWS, the extended support pricing is $0.60 per cluster per hour, while standard support costs $0.10 per cluster per hour.

Calculation:

For Extended Support

  • Number of clusters in extended support: 25
  • Cost per cluster per hour in extended support: $0.60
  • Total hourly cost for clusters in extended support: 25 clusters * $0.60 = $15.00
  • Total monthly cost for clusters in extended support (assuming 30 days): 25 * $0.60 * 24 * 30 = $10,800

For Standard Support

  • Number of clusters in standard support: 25
  • Cost per cluster per hour in standard support: $0.10
  • Total hourly cost for clusters in standard support: 25 clusters * $0.10 = $2.50
  • Total monthly cost for clusters in standard support (assuming 30 days): 25 * $0.10 * 24 * 30 = $1,800

Total Monthly Cost: $10,800 (extended support) + $1,800 (standard support) = $12,600

By running these 50 clusters, your additional monthly cost would be $12,600.

 

Amazon EKS Cost Optimization Best Practices or Cost-Saving Strategies

Upgrade to Newer Kubernetes Versions

Upgrading to the latest Kubernetes versions can save you money by avoiding extended support fees. Newer versions often come with performance improvements, new features, and enhanced security, which can also contribute to overall cost efficiency.

Steps to Upgrade:

  • Plan your upgrade by reviewing the release notes of the new Kubernetes version.
  • Test the upgrade process in a staging environment before applying it to production.
  • Follow AWS documentation for upgrading EKS clusters to ensure a smooth transition.

Right-Size Your EKS Nodes

Ensure that your EKS nodes are appropriately sized for your workloads. Over-provisioned nodes can lead to unnecessary costs.

Tips for Right-Sizing:

  • Use cluster autoscaling to dynamically adjust the number of nodes based on demand.
  • Regularly review and adjust instance types to match your workload requirements.
  • Use AWS Cost Explorer to analyze your usage patterns and identify opportunities for optimization.

Leverage Spot Instances

Spot Instances can significantly reduce your EKS costs by allowing you to bid on spare AWS compute capacity at reduced rates.

Implementation Tips:

  • Use Spot Instances for non-critical, fault-tolerant workloads.
  • Combine On-Demand and Spot Instances within your EKS cluster for a balanced approach.
  • Implement Spot Instance termination handling to gracefully manage interruptions.

Optimize Storage Costs

Storage can be a significant cost component of your EKS cluster. Optimize your storage usage by:

Best Practices:

  • Using EBS (Elastic Block Store) with appropriate volume types (e.g., General Purpose SSD, Provisioned IOPS SSD) based on performance needs.
  • Regularly cleaning up unused volumes and snapshots.
  • Utilizing EFS (Elastic File System) for shared storage across pods, ensuring you only pay for what you use.

Implement Efficient Monitoring and Logging

Efficient monitoring and logging can help you identify and address inefficiencies in your EKS clusters.

Tools and Techniques:

  • Use AWS CloudWatch for centralized logging and monitoring.
  • Implement logging level controls to minimize unnecessary log data.
  • Regularly review monitoring data to detect and resolve cost inefficiencies.

Technical Remediation Steps to Upgrade EKS Clusters

Using AWS CloudFormation

Steps:

  • Prepare a CloudFormation Template:
AWSTemplateFormatVersion: '2010-09-09'
Description: Upgrade EKS Cluster
Resources:
  MyEKSCluster:
    Type: AWS::EKS::Cluster
    Properties:
      Name: my-eks-cluster
      Version: "1.21"
      RoleArn: arn:aws:iam::123456789012:role/eksClusterRole
      ResourcesVpcConfig:
        SubnetIds:
          - subnet-abcde123
          - subnet-abcde456

 

  • Deploy the CloudFormation Stack:
aws cloudformation create-stack --stack-name upgrade-eks-cluster --template-body file://template.yaml

Using Terraform

Steps:

  • Prepare a Terraform Configuration:
provider "aws" {
  region = "us-west-2"
}

resource "aws_eks_cluster" "example" {
  name     = "example"
  role_arn = "arn:aws:iam::123456789012:role/eksClusterRole"

  vpc_config {
    subnet_ids = ["subnet-abcde123", "subnet-abcde456"]
  }

  version = "1.21"
}
  • Apply the Terraform Configuration:
terraform init
terraform apply -auto-approve

Confirming the Success of Your EKS Upgrade

After upgrading your EKS clusters, it’s crucial to confirm the upgrade was successful and that there are no outages or downtime affecting your business operations. Here are the technical steps to check the success of your upgrade:

 

Pre and Post-Upgrade Metrics to Check for Reducing EKS Costs

1. Node Health

  • Pre-Upgrade: Ensure all nodes are healthy using the following command:
    kubectl get nodes
  • Post-Upgrade: Re-run the above command to confirm all nodes are in a Ready state.

2. Pod Health

  • Pre-Upgrade: Check the status of your pods before the upgrade:
    kubectl get pods --all-namespaces
  • Post-Upgrade: Re-run the above command to ensure all pods are in a Running or Completed state.

3. Service Health

  • Pre-Upgrade: Verify that all services are up and running:
    kubectl get svc --all-namespaces
  • Post-Upgrade: Re-run the above command to ensure all services are running correctly.

4. EKS Control Plane Metrics

  • Pre-Upgrade: Monitor EKS control plane metrics using CloudWatch.
    • API Server: Check apiserver_request_count and apiserver_request_duration_seconds.
    • Scheduler: Check scheduler_scheduling_attempts_total.
    • Controller Manager: Check controller_runtime_reconcile_errors_total.
  • Post-Upgrade: Compare these metrics before and after the upgrade to ensure there are no significant anomalies.

5. Application Performance Metrics

  • Pre-Upgrade: Use application-specific monitoring tools to capture baseline performance metrics.
  • Post-Upgrade: Compare the performance metrics to the baseline to ensure there is no degradation.

6. Network Health

  • Pre-Upgrade: Check network policies and configurations.
    kubectl get networkpolicy --all-namespaces
  • Post-Upgrade: Re-check the network policies to ensure they are still in place and functioning.

Using CloudWatch Alarms

Set up CloudWatch alarms to monitor key metrics during and after the upgrade process. This will help you quickly detect and respond to any issues.

  • Node Status: Alarm on NodeNotReady.
  • Pod Status: Alarm on high PodPending counts.
  • API Server Errors: Alarm on high apiserver_request_errors.
  • Network Latency: Alarm on increased network latency metrics.

 

Leveraging Cloudgov.ai for EKS Cost Optimization

Managing EKS costs can be complex, especially when balancing the need for performance and reliability with budget constraints. This is where Cloudgov.ai can make a significant difference. Cloudgov.ai employs automated AI/ML policies to continuously check against your EKS versions and evaluate exact pricing, providing actionable insights for cost savings.

Why Cloudgov.ai?

  • Automated Monitoring: Continuously monitor your EKS clusters for cost optimization opportunities.
  • AI/ML Policies: Optimize your cloud costs with personalized recommendations from our advanced AI and machine learning algorithms, aligned with the policies.
  • Comprehensive Reporting: Generate detailed cost reports to understand your spend and identify savings opportunities.
  • Multi-Account Management: Track resources and costs across all AWS linked and master accounts, ensuring comprehensive cost management.

By leveraging Cloudgov.ai, you can ensure that your EKS clusters are not only efficient but also cost-effective, enabling you to focus on your core business objectives without worrying about runaway cloud expenses.

 

Conclusion

Optimizing costs for your Amazon EKS clusters involves a mix of strategic planning, ongoing management, and leveraging the right tools. By upgrading Kubernetes versions, right-sizing nodes, leveraging Spot Instances, optimizing storage, and implementing efficient monitoring, you can significantly reduce your EKS expenses. With Cloudgov.ai’s automated AI/ML policies, you can achieve even greater savings and efficiency, ensuring your cloud infrastructure is both powerful and economical.

Visit Cloudgov.ai to learn more about how we can help you optimize your EKS cluster costs and manage your cloud spend effectively.

Join our community and newsletter

Related posts

Ready to Slash Your Cloud Costs?

At CloudGov.ai, we harness the power of AI/ML to revolutionize FinOps, offering a platform that not only predicts savings but enacts them, slashing cloud costs by over 30%. Our platform doesn’t just identify savings; it provides precise, actionable solutions with ready-to-use code templates, making cloud optimization accessible for all, from engineers to non-technical FinOps experts.

The Cloudgov.ai Shield Family

Cloudgov.ai Programs

The Cloudgov.ai Partner Program

See all partner types →