Giter Site home page Giter Site logo

s7an-it / goldilocks-scraper Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stephangarland/goldilocks-scraper

0.0 0.0 0.0 29 KB

Scrapes Goldilocks VPA pages to easily add its recommendations to your deployment.

License: Mozilla Public License 2.0

Python 100.00%

goldilocks-scraper's Introduction

Goldilocks Recommendation Scraper

Acknowledgement

This would be an utterly useless tool without Goldilocks.

Why does this exist?

While Goldilocks does have a CLI that can output JSON, it doesn't clean up after itself, and is scoped to a single namespace.

Couldn't you have just run that in a for loop with kubectl get namespaces?

Go away.

Limitations

This does not change your k8s resource limits or requests, nor does it edit files for you. Honestly, that's probably a good thing. If you want to extend this to calling kubectl apply, be my guest, and be sure to post your prod disaster story later.

Prerequisites

  • Python 3.6+ for Typing and f-strings
  • Goldilocks installed in at least one cluster
  • A .kubeconfig file or some other method of authenticating with the cluster.
  • Packages from requirements.txt

Usage

usage: goldilocks_getter.py [-h] -d DOMAIN -f FILE [-m] \
       [-l {min,max,mean,median}] [-r {min,max,mean,median}] [-t]

This script scrapes recommendations from Goldilocks for all SOAs
in all namespaces, in all clusters available in the user's .kubeconfig.

optional arguments:
  -h, --help            show this help message and exit
  -d DOMAIN, --domain DOMAIN
                        domain where goldilocks is installed, 
                        e.g. foo.net
  -f FILE, --file FILE  Output file to store recommendations in
  -m, --mib             Use MiB instead of GiB for memory units
  -l {min,max,mean,median}, --limit {min,max,mean,median}
                        Stat to use for limits - defaults to max
  -r {min,max,mean,median}, --request {min,max,mean,median}
                        Stat to use for requests - defaults to median
  -t, --test            Only collect information from the first 
                        cluster to speed up testing

Example output

soa_1:
  resources:
    limits:
      cpu: 151.0m
      memory: 2.13Gi
    requests:
      cpu: 62.0m
      memory: 2.01Gi
soa_2:
  resources:
    limits:
      cpu: 25.0m
      memory: 0.24Gi
    requests:
      cpu: 25.0m
      memory: 0.24Gi

goldilocks-scraper's People

Contributors

stephangarland 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.