Coder Social home page Coder Social logo

kittypaws's Introduction

kittypaws

A tool for simulating destructive behavior of production infrastructure

Alt Text

WIP mode. Yet works for a few months in our company (doesn't mean it's stable).

Usage

Using cargo:

cargo run config.yml

Using distributive:

paws config.yml

Plugins

How to write a new plugin

Plugins are stored in ~/.kittypaws/plugins/ each in a folder named after plugin.

Python

Inside the folder there should be main.py with the run function:

def run(config: Dict[str, str]) -> None:
   pass

Bash

Inside the folder there should be run.sh:

config_field1=${config_field1:-default_value}

echo config_field1

Kittypaws will load it if plugin name is in the config and run with specified frequency.

Known plugins

Dropper

Drops connection to a certain IP address
https://github.com/subatiq/kittypaws-dropper

Deathloop

Simply restarts target container
https://github.com/subatiq/kittypaws-deathloop

Time burglar

Breaks time sync on the host
https://github.com/subatiq/kittypaws-timeburglar

Configuration structure

plugins:
- plugin01:
    config01: yes
    config02: 42
    ...
    
- plugin01:
    config03: yes
    config02: 44
    ...

Startup configuration

Plugins can start executing their tasks immediately, or after some time. You can configure them to wait for their interval first or wait for a specific delay and then continue to work normally.

Instant (hot) start

Config example:

- <plugin_name>: 
    ...
    startup: hot

Wait for the interval first (cold start)

Intervals configuration is described below.

Config example:

- <plugin_name>: 
    ...
    startup: cold  # works by default
    frequency: random
    max_interval: PT1M
    min_interval: PT30S

Here first plugin run will be executed after random interval.

Delayed start

Config example:

- <plugin_name>: 
    ...
    startup: PT5S
    frequency: random
    max_interval: PT1M
    min_interval: PT30S

With this config plugin will start after waiting 5 seconds, then it will only wait for random intervals between runs.

Interval configuration

Time durations in config comply with ISO 8601. Plugins can run in different intervals or once. To let kitty know how often you want them to run add this to plugin config:

Random intervals

Config example:

- <plugin_name>: 
    ...
    frequency: random
    max_interval: PT1M
    min_interval: PT30S

Fixed intervals

Config example:

- <plugin_name>: 
    ...
    frequency: fixed
    interval: PT1M

Run once

Used as default

Config example:

- <plugin_name>: 
    ...
    frequency: once # or do not put it in config at all, it's default

Go get these bugs, Tiger!

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.