Giter Site home page Giter Site logo

kreaper's Introduction

kreaper - Kubernetes Reaper

Go Report Card

kreaper is (yet another) Kubernetes pod reaper. It's main purpose is to delete pods matching a certain pod selector after a deadline is reached.

The testdata/ directory contains a Kubernetes manifest example how to deploy kreaper as Job that is automatically cleaned after 30s.

Configuration

kreaper only requires a few config options that are available as CLI flags or as environment variables. For the sake of simplicity environment variables are favored.

Env Flag Purpose Example Default
KREAPER_TARGET -target Target selection in the form of key=value app.kubernetes.io/name=ee8dcc4d ""
KREAPER_TARGET_NAMESPACE -target-namespace Namespace in which pods are watched and deleted my-app default
KREAPER_DRY_RUN -dry-run Skip actual deletion true false
KREAPER_LIFETIME -lifetime Duration after which all pods matching the target are deleted 30s 5m

Kubeconfig

kreaper is meant to be running within a Kubernetes cluster and therefore tries at first to read a in-cluster API config. If it fails to read the in-cluster config it tries to read the default $HOME/.kube/config file. The config file location can be modified either with the KUBECONFIG environment variable or by supplying a -kubeconfig flag.

RBAC

kreaper only needs:

  • list
  • watch
  • deletecollection

permissions for Pods in the KREAPER_TARGET_NAMESPACE. A very basic Role would look like so:

apiVersion: rbac.authorization.k8s.io/v1
kind: Role
metadata:
  name: kreaper
rules:
  - verbs:
      - list
      - watch
      - deletecollection
    apiGroups:
      - ""
    resources:
      - pods

alternatively a RoleBinding or a ClusterRoleBinding to the edit ClusterRole might be a little bit overkill but therefore also possible.

kreaper's People

Watchers

 avatar

kreaper's Issues

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

dockerfile
deployments/Dockerfile
github-actions
.github/workflows/go.yml
  • actions/setup-go v3
  • actions/checkout v3
  • codecov/codecov-action v3
  • golangci/golangci-lint-action v3
  • goreleaser/goreleaser-action v3
gomod
go.mod
  • go 1.19
  • github.com/maxatome/go-testdeep v1.12.0
  • go.uber.org/zap v1.23.0
  • k8s.io/api v0.25.0
  • k8s.io/apimachinery v0.25.0
  • k8s.io/client-go v1.5.2
  • sigs.k8s.io/controller-runtime v0.13.0
  • k8s.io/api v0.25.0
  • k8s.io/apiextensions-apiserver v0.25.0
  • k8s.io/apimachinery v0.25.0
  • k8s.io/client-go v0.25.0
  • k8s.io/component-base v0.25.0

  • Check this box to trigger a request for Renovate to run again on this repository

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.