GithubHelp home page GithubHelp logo

webbrandon / cluster-cost Goto Github PK

View Code? Open in Web Editor NEW
0.0 2.0 0.0 43 KB

Analyze and predict operating cost for a service in Kubernetes on AWS.

License: MIT License

Makefile 0.60% Shell 2.25% Rust 97.14%

cluster-cost's Introduction

Cluster Cost

Analyze and predict operating cost for a service in Kubernetes on AWS.

Install

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

Configuration

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

Autocompletion

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

USAGE

Refer to the help menu for details -h or --help.

Using the CLI

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

Using as Daemon

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.


Run As Daemon

cluster-cost --daemon
GET /predict/{node-type}/{cpu}/{memory}/{scale}

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.


Work In Progress

Feel free to contribute or use in any way.

Built with Rust love <3

cluster-cost's People

Contributors

webbrandon avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.