Giter VIP home page Giter VIP logo

raccoon's Introduction

raccoon

raccoon logo

Contributor Covenant

Description

Raccoon is a Command Line Interface aiming to provide ephemerality in a kubernetes environment. Ephemerality is a concept of things being transitory, existing only briefly.

Ephemerality will help to:

  • reduce hacks probability on a pod
  • avoid memory leak pitfalls
  • ensure to not rely on long-running workloads
  • ensure that we can restart a pod whenever we want/need
  • help enforcing immutability

For now, raccoon is only capable of collecting kubernetes pods resources.

Strategies

As raccoon is primarly focused on deleting pods. Those pods can start at the same time, when a new deployment happens, deleting pods with a same start time will result in a service unavailability.
To avoid this pitfall, raccoon is able to delete pods based on a strategy.

Randomized Delay

For now, there is only one strategy, called randomizedDelay which basically dispatch deletion over a certain time interval, to prevent service unavailability.

Build and install from source

Prerequisite tools

  • Docker daemon
  • Git
  • Go
  • pre-commit (used to generate README file for the helm chart)

Install from Github

Pre-requisites

# Install golangci-lint
## MacOS
brew install golangci-lint
## Linux & Windows
curl -sSfL https://raw.githubusercontent.com/golangci/golangci-lint/master/install.sh | sh -s -- -b $(go env GOPATH)/bin v1.45.2

# Verify
golangci-lint --version

# Install pre-commit hook
pre-commit install
mkdir $HOME/src
cd $HOME/src
git clone https://github.com/backmarket-oss/raccoon.git
cd raccoon
make install

Pull docker image

raccoon docker image is available at ghcr.io/backmarket-oss/raccoon:latest.

Usage

Each raccoon's flag is available as an environment variable with RACCOON_ as prefix.

Helm repository

Raccoon helm repository is available at https://backmarket-oss.github.io/raccoon/, please follow these instructions to use it:

$ helm repo add raccoon https://backmarket-oss.github.io/raccoon

$ helm search repo raccoon
NAME                    CHART VERSION   APP VERSION     DESCRIPTION               
backmarket-oss/raccoon  1.0.0           1.0.0           Ephemerality in kubernetes

Here is the available commands in raccoon

garbage

Used to run raccoon daemon and start marking and collecting k8s pods.
namespace and selector are the two mandatory flags.

For now, we have only one strategy to collect resources, it is the randomized delay strategy.
At each --check-interval and for each resource to collect we apply a --randomized-delay to avoid deleting all the resources in one shot.

$ raccoon garbage

Run raccoon daemon

Usage:
  raccoon garbage [flags]

Flags:
      --check-interval int     Interval between two raccoon check (default 120)
      --dry-run                Test process without deletion
  -h, --help                   help for garbage
      --kube-location string   Connection mode to the kubernetes api (in or out) (default "in")
      --kubeconfig string      Path to KUBECONFIG file. Ignored if KUBECONFIG envvar is set (default "${HOME}/.kube/config")
  -n, --namespace string       Namespace to raccoon (required)
      --randomized-delay int   Delay the deletion by a randomly amount of time [value/2,value] (default 120)
  -s, --selector string        Selector (label query) to filter on, supports '=', '==', and '!='.(e.g. -l key1=value1,key2=value2) (required)
      --ttl string             Minimum age by which a pod will be deleted (default 24h0m0s)

Global Flags:
      --level string   set log level (default "info")

About the project

Getting involved and contributing

See contribute.

Why naming it raccoon?

Since they are omnivores, berries, fruit, eggs, lizards, crustaceans, fish, wild birds, domestic poultry, and garbage scraps are their main source of food. This is why they eat "garbage". To them, it is just another source of food that is easily accessible.

They eat "garbage", that is what we do in this project. Collecting and deleting garbage resources.

License

Raccoon is released under the Apache 2.0 license. See LICENSE

raccoon's People

Contributors

dependabot[bot] avatar sterchelen avatar

Stargazers

Johnson Masilla Vino avatar Vivek Prasad avatar josephedward avatar Grank avatar Zakaria EL BAZI avatar Rachid Zarouali avatar  avatar Théotime Lévêque avatar Chris Dupin avatar Pierre-Emmanuel Altieri avatar Shashi Kumar Nagulakonda avatar Tim Kersey avatar Benoît Sauvère avatar Klemen Sever avatar Elias Dorneles avatar Chahrazed YOUSFI avatar Nicolas Dréno avatar Guillaume Rams avatar

Watchers

Florian Valeye avatar  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.