revvy

package module
v0.0.0-...-dfb2727 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

README

revvy

revvy is a simple tool for performing resource scale testing against your kubernetes cluster. Think of it as a gas pedal; push as much as you want.

design

Why use revvy?

I started with various forms of "simple" scale testing for k8s clusters; bash scripts, one-off manifests, kubectl copy-pasta, and terraform modules.

Ultimately, I wanted a single solution that works on all the platforms I develop on: Windows, Mac, and Linux. Enter revvy.

default kubeconfig paths

Windows: $HOME\.kube\config
Linux/Mac: $HOME/.kube/config

usage

revvy resource count --kubeconfig /path/to/kube/config

Note: revvy will attempt read the local KUBECONFIG variable if the --kubeconfig parameter is not set.

Some resources have additional parameters, which are noted below:

pod: image

  • set a custom container image. The default is busybox.

secret: size

  • set a custom secret size in kilobytes. The default is a random size in the range of 1Kb to 1500Kb for each secret revvy creates.

examples

# Create 500 namespaces
revvy namespace 500

# Create 5000 secrets with a static size of 750Kb
revvy secret 5000 --size 750 

# Create 5000 secrets with auto-generated size ranging from 1Kb to 1500Kb
# The default behavior for revvy when performing secret generation is to randomize the size of each secret
revvy secret 5000

# Create 875 pods using the default busybox container image
revvy pod 875

# Create 875 pods using a custom container image
revvy pod 875 --image cptrosskirk/busybox-scaler

garbage collection

  • Does revvy cleanup after itself?

Not unless you tell it to. revvy was intended to be a "scale until it breaks" tool. With that design in mind, I opted to make cleanup a manual task as the easier solution would be to tear down and build a new kubernetes cluster.

  • How can I tell revvy to cleanup the resources it creates?

revvy cleanup will attempt to perform a deletion on every resource it created by looking for the revvy-made-this: true label on each resource in the specified k8s cluster. revvy will prompt for confirmation prior to starting the cleanup unless --approve is also passed.

Should I run this in production?

No.

If you really want to run revvy in prod, I have an ocean-view condo in Arizona available too.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultConfigFile = fmt.Sprintf(os.Getenv("HOME") + defaultName + "config.yaml")
)

Functions

func ParseFlags

func ParseFlags() (string, error)

ParseFlags will create and parse the CLI flags and return the path to be used elsewhere

func ValidateConfigPath

func ValidateConfigPath(path string) error

Types

type Config

type Config struct {
	Scale     Scaler `json:"scale" yaml:"scale"`
	Namespace string `json:"namespace" yaml:"namespace"`

	Type     ResourceType
	Obj      runtime.Object
	LogLevel string `yaml:"loglevel, logLevel"`
	// contains filtered or unexported fields
}

func LoadConfig

func LoadConfig(path string) (*Config, error)

LoadConfig returns a new decoded Config struct

func (Config) Parser

func (config Config) Parser(c client.Client) error

type ResourceType

type ResourceType struct {
	// contains filtered or unexported fields
}

type Scaler

type Scaler struct {
	Resource  string `json:"resource" yaml:"resource"`
	Namespace string `json:"namespace" yaml:"namespace"`
	Request   int    `json:"request" yaml:"request"`
}

func (*Scaler) Scale

func (s *Scaler) Scale(c client.Client, config Config, obj runtime.Object) error

Directories

Path Synopsis
internal
pkg

Jump to

Keyboard shortcuts

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