AWS Cost Efficiency

AWS Elastic Kubernetes Service (EKS): Cost and Pricing

Document

Did you know?

As of 2024, AWS EKS customers have launched a staggering number of Kubernetes pods, exceeding 100 billion in total! This translates to millions of pods launched every hour, demonstrating the immense scale and popularity of EKS for deploying containerized applications.

Amazon EKS maintains the available and scalable control plane nodes that schedule containers, manage application availability, store cluster data, and perform other vital tasks in Kubernetes. Over 60 percent of organizations have adopted Kubernetes already. Efficiently managing costs while maintaining top performance is essential for businesses using AWS Elastic Kubernetes Service (EKS). Finding ways to optimize EKS expenses ensures smart resource allocation, delivering value without overspending.

In this guide you will explore EKS pricing and some strategies to cut down your EKS costs.

AWS EKS Cost & EKS Pricing

Amazon EKS provides flexible pricing options customized to user needs, offering choices like Extended Support for Kubernetes Versions, Amazon EKS on AWS Fargate, and Amazon EKS on AWS Outposts. These models offer varying pricing structures, allowing users to select the best fit for their workload and budget. This approach deviates from exact pricing, enabling users to optimize costs based on usage patterns and requirements.

EKS Pricing Category Description
Extended Support for Kubernetes Versions -Run EKS clusters on a Kubernetes version for up to 26 months.
-Cost: $0.60/hour per cluster, inclusive of the $0.10/hour for EKS clusters.
Amazon EKS on AWS Fargate -Pricing is based on vCPU and memory resources used.
-Minimum charge: one minute.
-Detailed pricing on AWS Fargate page
Amazon EKS on AWS Outposts -Pricing: $0.10/hour per cluster for EKS service.
-Not included in Outposts pricing.
-Refer to AWS Outposts Rack pricing for capacity pricing details.

AWS Fargate EKS Pricing

Pricing Example to demonstrate Fargate EKS pricing

  • Scenario- Your service utilizes 10 EKS Pods running continuously for 1 hour every day for a month in the US East (N. Virginia) region. Each EKS Pod is configured with 0.25 vCPU and 1 GB memory
  • Monthly CPU charges

Total vCPU charges = (number of Pods) x (number of vCPUs) x (price per CPU-second) x (CPU duration per day by second) x (number of days)  

Total vCPU charges = 10 x 0.25 x 0.000011244 x 3600 x 30 = $3.04  

  • Monthly memory charges

Total memory charges = (number of Pods) x (memory in GB) x (price per GB) x (memory duration per day by second) x (number of days)  

Total memory charges = 10 x 1 x 0.000001235 x 3600 x 30 = $1.33

  • Monthly Fargate compute charges

Monthly Fargate compute charges = (monthly CPU charges) + (monthly memory charges)  

Monthly Fargate compute charges = $3.04 + $1.33 = $4.37 ‍

AWS Outposts EKS Pricing

Pricing Example to demonstrate EKS pricing for Outposts

  • Scenario: To deploy their production workloads, a company intends to set up a medium-sized Kubernetes cluster utilizing Amazon EKS on Outposts. Their specifications include a cluster comprising three managed nodes, each utilizing the c5.large instance type. Additionally, they require 500 GB of storage allocated through Amazon EBS General Purpose SSD (gp2) volume. For data transfer, the company anticipates outbound traffic of up to 5 TB per month.      
  • Instance Type (c5.large):

On-Demand Pricing: $0.108 per hour per instance

Total cost for 3 instances: $0.108 * 3 * 24 * 30 = $233.28 per month

  • Storage (500 GB of gp2 volume):

$0.10 per GB-month: (500 GB * $0.10) = $50 per month

Data Transfer (5 TB out per month): $0.09 per GB for the first 10 TB: (5000 GB * $0.09) = $450 per month

  • Total monthly cost:

Total monthly cost for EKS on Outposts: $233.28 + $50 + $450 = $733.28 

Extended Support for Amazon Kubernetes Pricing

Pricing Example to demonstrate EKS Extended Support Costs

  • Scenario: A company operates a Kubernetes cluster on Amazon EKS for production workloads. To extend support beyond the standard EKS lifecycle, they're considering Extended Support for Kubernetes Versions. Their cluster has 5 m5.large managed nodes, 1TB of gp2 storage, and anticipates 10TB monthly data transfer. These specs drive cost evaluation for Extended Support.
  • Managed Node Pricing:

EKS Node Pricing (m5.large): $0.10 per hour per node

Number of nodes: 5

Total cost for managed nodes = $0.10 * 5 * 24 * 30 (assuming 30 days) = $360 per month

  • Storage Pricing:

Amazon EBS General Purpose SSD (gp2): $0.10 per GB-month

Storage volume: 1 TB = 1024 GB

Total cost for storage = $0.10 * 1024 = $102.40 per month

  • Data Transfer Pricing:

Data transfer out to the internet: $0.09 per GB

Data transfer out: 10 TB

Total cost for data transfer = $0.09 * 10,000 = $900 per month

  • Total monthly cost

$360 + $102.40 + $900 = $1362.40

Cost Comparison: EKS on AWS Outposts, Fargate EKS Pricing, and Extended Support  EKS Pricing

This table compares Factors affecting pricing models for Amazon EKS offerings: EKS on Outposts, EKS on Fargate, and Extended Support for Kubernetes Versions. It provides insights into cluster size, instance types, pod resources, networking, storage, and AWS resource usage and checks on the effect of pricing. This comparison aids in understanding the differences between each offering, facilitating informed decision-making.

Factor EKS on Outposts EKS on Fargate Extended Support for Kubernetes Versions
Cluster Size Yes Yes Yes
Instance Type Yes No No
Pod Resources Yes No No
Networking Yes No No
Storage Yes No No
AWS Resource Usage Yes Yes Yes

Strategies to reduce AWS EKS costs and increase savings

1. Auto Scaling

Amazon EKS offers dynamic Auto Scaling capabilities, adjusting cluster size based on workload demand. This involves configuring Auto Scaling Groups (ASGs) for EKS worker nodes and defining scaling policies. Utilizing features like Horizontal Pod Autoscaler (HPA) and Cluster Autoscaler maximizes resource utilization by automatically adjusting pod and cluster sizes. By aligning resource allocation with workload fluctuations, Auto Scaling effectively manages costs.

Here's how to implement Auto Scaling using HPA and Cluster Autoscaler:

Horizontal Pod Autoscaler (HPA)

apiVersion: autoscaling/v2beta2
kind: HorizontalPodAutoscaler
metadata:
  name: my-app-hpa
  namespace: default
spec:
  scaleTargetRef:
    apiVersion: apps/v1
    kind: Deployment
    name: my-app
  minReplicas: 1
  maxReplicas: 10
  metrics:
  - type: Resource
    resource:
      name: cpu
      target:
        type: Utilization
        averageUtilization: 50

Cluster Autoscaler

kubectl apply -f https://github.com/kubernetes/autoscaler/releases/download/cluster-autoscaler-1.21.0/cluster-autoscaler-autodiscover.yaml

kubectl annotate deployment cluster-autoscaler \
    -n kube-system cluster-autoscaler.kubernetes.io/safe-to-evict="false"

kubectl set env deployment cluster-autoscaler \
    -n kube-system \
    AWS_REGION=<your-region> \
    CLUSTER_NAME=<your-cluster-name>

2. Implement Right-Sizing

To optimize EKS costs, analyze resource usage and adjust pod resource requests and limits accordingly. Implement Horizontal Pod Autoscaling (HPA) and Cluster Autoscaler to dynamically scale resources based on workload demands, preventing over-provisioning. Continuously monitor and optimize resource allocations to ensure efficient utilization and minimize costs over time.

3. Implement Down Scaling

Analyze resource usage to establish thresholds for downsizing based on metrics such as CPU and memory. Automate adjustments using autoscaling tools according to predefined criteria, optimizing cluster configuration and monitoring performance to sustain efficiency. By refining scaling policies to suit evolving workload demands, downscaling ensures optimal resource utilization and minimizes unnecessary infrastructure expenses through efficient resource management.

4. Utilize AWS Purchase Options

Reduce EKS costs by leveraging AWS purchase options like Reserved Instances (RIs), Savings Plans, and Spot Instances. These options offer significant savings compared to On-Demand pricing, with Reserved Instances providing potential savings of up to 70%, Savings Plans offering up to 72% savings, and Spot Instances delivering even higher savings of up to 90%. Choose options based on workload predictability and fault tolerance and utilize EKS-specific Savings Plans for cluster optimization. Regularly monitor usage with tools like AWS Cost Explorer to identify cost-saving opportunities and adjust resource allocation accordingly.

5. Elastic Container Registry (ECR) Lifecycle Policies

Reducing EKS costs with Elastic Container Registry (ECR) Lifecycle Policies involves defining rules to manage container images more efficiently. By configuring lifecycle policies, you can automate image cleanup based on criteria such as image age or tag. This ensures that only necessary images are stored in the registry, reducing storage costs. Additionally, consider using immutable tags to prevent accidental deletion of critical images. Regularly review and optimize lifecycle policies to align with your application's requirements and minimize unnecessary storage expenses.

Here's how to implement ECR Lifecycle Policies:

{
  "rules": [
    {
      "rulePriority": 1,
      "description": "Expire untagged images older than 30 days",
      "selection": {
        "tagStatus": "untagged",
        "countType": "sinceImagePushed",
        "countUnit": "days",
        "countNumber": 30
      },
      "action": {
        "type": "expire"
      }
    }
  ]
}

Apply the lifecycle policy using AWS CLI:

aws ecr put-lifecycle-policy \
    --repository-name <repository-name> \
    --lifecycle-policy-text file://lifecycle-policy.json

6. Choose the Appropriate Offering Based on Your Workload

Selecting the most suitable EKS offering based on your workload characteristics can significantly impact cost efficiency. Consider factors such as instance types, managed services, and scalability options to optimize resource utilization and minimize expenses.

7. Resource Forecasting and Planning

Conduct thorough resource forecasting and planning to accurately estimate your EKS resource requirements. By understanding your workload patterns and growth projections, you can provision resources more effectively, avoiding over-provisioning and unnecessary costs.

Conclusion

To cut down EKS costs effectively, use Auto Scaling to adjust cluster size dynamically based on workload changes. Right-Sizing helps optimize resource usage by matching allocation with actual needs, while Down Scaling sets thresholds for downsizing based on CPU and memory metrics. Leveraging AWS Purchase Options like Reserved Instances and Spot Instances offers significant savings compared to On-Demand pricing. Implement Elastic Container Registry (ECR) Lifecycle Policies to efficiently manage container images, minimizing unnecessary storage costs. Regular optimization ensures ongoing cost efficiency and alignment with application requirements.

FAQ's

1. What are the primary cost components of Amazon EKS?

Amazon EKS costs include control plane fees, worker node instance charges, storage, and data transfer fees. This encompasses various elements like EKS cluster cost, EKS control plane cost, and EKS data transfer cost, contributing to the overall AWS EKS costs.  

2. How can I reduce my Amazon EKS costs effectively?

To reduce AWS EKS costs use Auto Scaling, right-size your resources, leverage AWS purchase options like Reserved Instances and Spot Instances, and implement ECR lifecycle policies. This approach can help lower AWS EKS price and manage AWS EKS cluster pricing more efficiently.

3. What is the cost advantage of using Amazon EKS on AWS Fargate?

AWS Fargate pricing for EKS is based on the resources (vCPU and memory) used, allowing for cost efficiency by paying only for what you consume. This can significantly reduce EKS Fargate cost and overall EKS cost per month.

4. How does Amazon EKS on AWS Outposts differ in pricing?

EKS on Outposts incurs control plane costs, instance costs, storage fees, and data transfer costs, which are separate from Outposts capacity pricing. This adds to the overall AWS EKS charges and affects the EKS control plane pricing and EKS AWS cost.

5. What strategies help in optimizing EKS costs for fluctuating workloads?

Implementing Auto Scaling, Horizontal Pod Autoscaler (HPA), and Cluster Autoscaler can dynamically adjust resource allocation based on workload demands, ensuring cost efficiency. This helps in managing EKS costs , especially for fluctuating workloads, contributing to a more predictable AWS kubernetes cluster pricing.

Subscribed !
Your information has been submitted
Oops! Something went wrong while submitting the form.

Similar Blog Posts

Maintain Control and Curb Wasted Spend!

Strategical use of SCPs saves more cloud cost than one can imagine. Astuto does that for you!