kubectl-vpa

command module
v0.7.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2023 License: MIT Imports: 3 Imported by: 0

README

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

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.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
app
vpa_v1
Package vpa_v1 contains definitions of Vertical Pod Autoscaler related objects.
Package vpa_v1 contains definitions of Vertical Pod Autoscaler related objects.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL