Code Monkey home page Code Monkey logo

kubernetes-cost-report's Introduction

Kubernetes Cost Report

gopherbadger-tag-do-not-edit Docker Gosec Reviewdog

Deep Dive Explanation

Kubernetes Cost Report

Architecture

Requirements

brew install go

IAM

To be able to query for prices you should have the following permissions:

AWS

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Action": [
                "pricing:*"
            ],
            "Effect": "Allow",
            "Resource": "*"
        },
        {
            "Action": [
                "ec2:Describe*"
            ],
            "Effect": "Allow",
            "Resource": "*"
        }
    ]
}

You could run the terraform code to create it.

set the following variables to be able to run the code:

  • oidc_url: eks cluster url where you will be running the exporter.
  • role_name: the name of the role to be created.
  • terraform_role_ARN: the role which will create the resources.
cd terraform
terraform init
terraform apply

Build

## Binary
make build
## Docker
make docker

For those who wants keep it simple and avoid install a lot of things:

docker build . -t cost-report
docker run -p 8080:8080 cost-report

Development

go mod vendor
go run main.go

Endpoints

  • Metrics: localhost:8080/metrics
  • Healthcheck: localhost:8080/health

Metrics

instance_cost_all

Name Description
label_beta_kubernetes_io_instance_type machine type
label_eks_amazonaws_com_capacity_type instance type
vcpu virtual cpu
memory memory
unit unit
Description description
label_topology_kubernetes_io_zone availability zone
region region

instance_cost

Name Description
label_beta_kubernetes_io_instance_type machine type
label_eks_amazonaws_com_capacity_type instance type
vcpu virtual cpu
memory memory
unit unit
Description description
label_topology_kubernetes_io_zone availability zone
region region

instance_mem_price

Name Description
label_beta_kubernetes_io_instance_type machine type
label_eks_amazonaws_com_capacity_type instance type
unit unit
label_topology_kubernetes_io_zone availability zone
region region

instance_cpu_price

Name Description
label_beta_kubernetes_io_instance_type machine type
label_eks_amazonaws_com_capacity_type instance type
unit unit
label_topology_kubernetes_io_zone availability zone
region region

instance_capacity

Name Description
label_beta_kubernetes_io_instance_type machine type
label_eks_amazonaws_com_capacity_type instance type
unit unit
label_topology_kubernetes_io_zone availability zone
region region

instance_discount

Name Description
label_beta_kubernetes_io_instance_type machine type
label_eks_amazonaws_com_capacity_type instance type
unit unit
label_topology_kubernetes_io_zone availability zone
region region

kubernetes-cost-report's People

Watchers

 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.