Analyze and predict operating cost for a service in Kubernetes on AWS.
Use the below command to install binary or build from source.
Binary install:
curl https://webbrandon.github.io/cluster-cost/install.sh -sS | bash -s
Source install:
git clone https://github.com/webbrandon/cluster-cost.git
cd cluster-cost
make build
make install
In an effort to make configuration simple we have defined a YAML config to handle node type mapping. This config can managed through ~/.cluster_cost/config.yaml
. To change the base path you can set it with an environment field CLUSTER_COST_CONFIG_BASE
.
The first time you run the cli utility you will be prompted to configure node types if no config not found.
NOTE Node type price is expected to be by the month.
~/.cluster_cost/config.yaml
kind: config
version: alpha/1.0
specs:
nodeTypes:
2x.xhighmem:
price: 50.11
cpu: 8
memory: 32
For convenience purposes autocompletion scripts have been provided for most major shell programs. Hopefully this make it more useable for daily use if engineers.
More information for each completion script provided:
cluster-cost configuration --help
Refer to the help menu for details -h
or --help
.
Single pod calculation on 2x.xhighmem.
cluster-cost predict -n 2x.xhighmem --cpu 3 --memory 9
20 pod calculation on 2x.xhighmem.
cluster-cost predict -n 2x.xhighmem --cpu 3 --memory 9 --scale 20
Analyze the entire cluster.
cluster-cost analyze
Analyze the a single namespace environment.
cluster-cost analyze --namespace production
Daemon mode runs cluster_cost as HTTP REST service. You can either use the options arguments to predefine route values or environment value equivalents. See below examples.
cluster-cost --daemon
Response:
{
"data": {
"attributes": {
"url": "<signed-url>",
"method": "PUT",
"ttl": 60000,
"engine": "aws",
"request": "<uri-received-for-request>"
}
}
}
Find more ways to configure it using --help
flag. The above two use case examples show routes accessible when deployed with different parameters.
Feel free to contribute or use in any way.
Built with Rust love <3