/arbeitsinspektor

A simple automated time-based scaling job for Kubernetes

Primary LanguageErlangApache License 2.0Apache-2.0

arbeitsinspektor

The Arbeitsinspektor (Health and Safety Executive) makes sure workloads within your Kubernetes cluster abide the relevant labour laws.

What?

arbeitsinspektor is a simple kubernetes cron job that scales workloads based on time. For example some workloads should only run within the timeframe of mon-fri[07:00-17:00]. arbeitsinspektor takes care of that. Definition are stored in a CRD businesshours.

Example:

 definitions:
 - definition: mon-fri[07:00-17:00]
   label:
     k8s.some.company/environment: development

All deployments with the label k8s.some.company/environment=development are only allowed to run between monday and friday from 07:00 UTC - 17:00 UTC. Outside of these times the affected workloads will be scaled to zero.

Alternatives

Containers with kubectl installed and some shell magic may achieve comparable results. See here.

At its current state arbeitsinspektor does not provide any additional functionality compared to a hand-rolled solution as the one proposed. However this is subject to change.

Usage

arbeitsinspektor can be installed using helm.

$ helm repo add arbeitsinspektor https://fridayy.github.io/arbeitsinspektor
$ helm install arbeitsinspektor arbeitsinspektor/arbeitsinspektor -f values.yaml

Possible configuration values are documented in the next section.

Configuration

tbd

Development:Build

$ rebar3 compile