GithubHelp home page GithubHelp logo

melodyyangaws / emr-on-eks-cost-tracking-solution Goto Github PK

View Code? Open in Web Editor NEW

This project forked from aws-samples/emr-on-eks-cost-tracking-solution

0.0 0.0 0.0 38 KB

License: MIT No Attribution

Shell 30.98% Python 66.13% Dockerfile 2.89%

emr-on-eks-cost-tracking-solution's Introduction

Emr Eks Cost Tracking

This repository contains a series of automation to help in the deployment of a cost tracking solution for EMR on EKS. The implementation details of the repository are covered in this blog.

Deploy

First execute deploy-emr-eks-cost-tracking.sh the script expect the following in this order: region, kubecost version, eks cluster name, and account id.

sh deploy-emr-eks-cost-tracking.sh REGION KUBECOST-VERSION EKS-CLUSTER-NAME ACCOUNT-ID

Example

sh deploy-emr-eks-cost-tracking.sh eu-west-1 1.102.0 emreks 111111111

What is deployed

Amazon Managed Prometheus

Use by Kubecost to store metrics.

IAM Roles

Glue crawlers, tables and database

A Glue database used to encompass all tables that store cost data.

Two glue tables:

* One used to store information about CUR data
* Used to store the compute cost related to each job

A Glue crawler:

* Used to crawler CUR data and update the table partitions

Lambda function

A lambda function to trigger the glue craweler everytime there is new data put by Cost and Usage Report.

S3 buckets

Two S3 buckets:

* cost-data-REGION-ACCOUNT_ID: used to store cost data
* aws-athena-query-results-cur-REGION-ACCOUNT_ID: used to store Athena query results

Athena Workgroup:

An Amazon Athena workgroup named: emreks-compute-cost-exporter. This workgroup is use by Kubecost to query CUR data.

Cost and Usage Report:

Used by Kubecost and to get cost by Job in EMR on EKS.

Spot feed:

Used to get spot price data and used by Kubecost.

Destroy

To delete all the resources created. First empty these two s3 buckets cost-data-REGION-ACCOUNT_ID and aws-athena-query-results-cur-REGION-ACCOUNT_ID, then Athena workgroup emr-eks-cost-analysis and last empty the ECR repository with the name emreks-compute-cost-exporter. Execute the following file destroy-emr-eks-cost-tracking.sh.

sh destroy-emr-eks-cost-tracking.sh REGION EKS-CLUSTER-NAME

Example

sh destroy-emr-eks-cost-tracking.sh eu-west-1 emreks

Security

See CONTRIBUTING for more information.

License

This library is licensed under the MIT-0 License. See the LICENSE file.

emr-on-eks-cost-tracking-solution's People

Contributors

amazon-auto avatar lmouhib avatar melodyyangaws 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.