GithubHelp home page GithubHelp logo

ninlil / kubectl-vpa Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 16.88 MB

Tool to manage VPAs (vertical-pod-autoscaler) resources in a kubernetes-cluster

License: MIT License

Makefile 0.54% Go 99.15% Shell 0.31%
kubectl-plugin verticalpodautoscaler

kubectl-vpa's Introduction

kubectl-vpa

Tool to manage VPAs (vertical-pod-autoscaler) resources in a kubernetes-cluster

  • Create, Compare, Change UpdateMode and Suggest limits

Go Report Card

Getting started

Prerequisites

Install the Vertical-Pod-Autoscaler from the official kubernetes/autoscaler-project

Recommended reading

Vertical Pod Autoscaling: The Definitive Guide by Povilas Versockas

Install & Run

To install:

go install github.com/ninlil/kubectl-vpa

To run:

kubectl-vpa ...

or using the kubectl-plugin-behavior

kubectl vpa ...

Quick-start

This will create a VPA-resource for all runnings pods that dont yet have one (with UpdateMode = Off)

kubectl-vpa compare -A -! -b | kubectl-vpa create -f - | kubectl apply -f -

Help and options

All command have their own help. Example:

kubectl-vpa compare -h

Create a VPA-resource

kubectl-vpa create foo/bar

This will find a Pod, Deployment, Daemonset, Statefulset or CronJob named 'bar' in the 'foo' namespace and output a document that is the VPA-resource of the found match.

Change 'mode' of a VPA

kubectl-vpa mode initial -n foo bar1 bar2 bar3 database/mysql

This will set the UpdateMode to 'Initial' on VPA bar1, bar2 & bar3 in namespace foo, and on mysql in the database namespace

Suggest limits (WIP)

kubectl-vpa suggest foo/bar

This will create snippets for us in a deployment (or other) resource describing requests if you do not want to use the 'recommender' module from the VPA

Compare VPA with current requests

This will match current running pods and their current requests with matching VPA and output differences.

Sorting, filtering and head/tail of output is also available.

Examples

Compare all VPA's in namespace foo

kubectl-vpa compare -n foo

List all pods (including those without a matching VPA), with a sum-line

kubectl-vpa compare -A -l -z

The output

The following columns are printed:

  • Namespace
  • Name (name of pod)
  • Mode (the UpdateMode, used by the recommender)
  • Container
  • Req-CPU (the request-cpu of the container in the current instance, in milli-units)
  • VPA-CPU (the 'Target'-value of the matching VPA)
  • CPU diff% (difference between the previous 2 values)
  • Req-RAM (the request-memory of the container in the current instance, in M-units)
  • VPA-RAM (the 'Target'-value of the matching VPA)
  • Mem. diff% (difference between the previous 2 values)
  • sum(ฮ”) (the sum of the 2 diff%-values)

The 'diff%' values will be positive when a container is requesting more that it probably needs, meaning a negative value is when it should probably request more than it's currently doing.

The 'Mode' column will display '---' onlines that don't match a VPA.

kubectl-vpa's People

Contributors

ninlil avatar

Stargazers

 avatar  avatar  avatar

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.