STATUS: This proposal is a working draft, it will get refined and augmented as needed. If any non-trivial changes are needed to functionality defined here, in particular the user experience, those changes should be suggested via a PR to this proposal document. Any other changes to the text of the proposal or technical corrections are also very welcome.
The main challenge of the cost estimation is to calculate the price induced by a cluster create
or a cluster scale
(V2) command.
For the first version, we can focus on EC2 Instances type cost, EBS Volumes cost, EKS cluster cost per region.
For future versions, we can introduce new features like: EC2 Data Transfer, Elastic Load balancer, etc.
API Used Amazon provides AWS Price List API : https://pricing.us-east-1.amazonaws.com/offers/v1.0/aws/index.json. We can use it to get the current pricing of each service, in our case: EC2, EBS, EKS.
Parameters
eksctl calculator
uses the same parameters as eksctl create
and eksctl scale
(V2) + specifics parameters.
Existing parameters
- name: ignored. No extra cost.
- tags: ignored. No extra cost.
- zones: ignored. No extra cost.
- version: ignored. No extra cost.
- region: Used to calculate the cost. The cost is per region
- nodes: Used to calculate the cost unless nodes-min is provided
- nodes-min: Used to calculate the cost. Minimum number of instances used
- nodes-max: ignored.
- node-type: Used to calculate the cost. The cost depends on the instance type
- node-volume-size: Used to calculate the cost. The cost depends on the volume size
- node-volume-type: Used to calculate the cost. The cost depends on the volume type
- max-pods-per-node: ignored. No extra cost.
- node-ami: ignored. (V2)
- node-ami-family: ignored. (V2)
- ssh-access: ignored
- ssh-public-key: ignored
- node-private-networking: ignored
- node-security-groups: ignored. No extra cost.
- node-labels: ignored. No extra cost.
- node-zones: ignored. No extra cost.
- temp-node-role-policies: ignored. No extra cost.
- temp-node-role-name: ignored. No extra cost.
- asg-access: ignored. No extra cost.
- external-dns-access: ignored. No extra cost.
- full-ecr-access: ignored. No extra cost.
- storage-class: Used to calculate the cost. The cost depends on the storage class
- vpc-private-subnets: ignored. (V2)
- vpc-public-subnets: ignored. (V2)
- vpc-cidr: ignored. (V2)
- vpc-from-kops-cluster: ignored. (V2)
Specifics parameters
Usage
Used to estimate the usage of the cluster and its nodes. By default, it's a full utilization: --usage-type=utilization --usage-value=100
.
- usage-type: String. Possible values:
demo
orutilization
orday
orweek
ormonth
. - usage-value: Integer. Min value is
1
hour. Max value depends onusage-type
:24
hours fordemo
andday
,100
% forutilization
,168
hours forweek
,732
hours formonth
.
Examples:
- Demo
--usage-type=demo --usage-value=3
- % Utilized/Month
--usage-type=utilization --usage-value=54
- Hours/Day
--usage-type=day --usage-value=24
- Hours/Week
--usage-type=week --usage-value=2
- Hours/Month
--usage-type=month --usage-value=5
Free Tier
- free-tier: yes/no (yes by default)
Response example
eksctl calculator --name=cluster-1 --region=eu-west-1 --nodes=2
[ℹ] using region eu-west-1
[ℹ] using "ami-0ce0ec06e682ee10e" for nodes
[ℹ] 2 nodes m5.large
[ℹ] EBS volumes 20go
[ℹ] free tier "yes"
[ℹ] usage type "utilization"
[ℹ] usage value "100%"
[✔] estimation (per month):
- Amazon EC2 Service (EU (Ireland)): $ 158.86
-- Compute: $ 156.66
-- EBS Volumes: $ 2.20
- EKS Cluster: $ 146.4
total: $ 305.26
Usecase (V2)
Aims at giving an estimation of a Common Customer Samples
: free-website, bigdata app, machine learning app, serverless, etc.
It generates a yml file which contains a recommended configuration.
For example:
eksctl calculator --usecase=free-websites --region=eu-west-1 --free-tier=yes
eksctl calculator --usecase=addons --region=eu-web-1 --free-tier=yes --addons jenkins-x