perimener

command module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 7, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

README

Perímener ✋

GitHub license

Named after the Greek word Perímene αναμονή for wait.

A golang application that waits for the expected number of pods to reach a Ready state before gracefully exiting.

Problem statement

Have you ever needed an initContainer which can perform simple dependency management.

Starting containers before their dependencies are ready can result in pods going into a status of CrashLoopBackoff these wastes resources which could have been used on the dependencies themselves.

An example of this might be ensuring that a number of zookeeper pods reach a Ready state before kafka is started.

Perímener also has functionality to avoid the thundering herd issue which is amplified when using GitOps principles.

Setting an environment variable inserts a random delay from 0 to <RANDOM_WINDOW_SECONDS> to application startup which can help prevent undesirable autoscaling events.

Usage

Configuration is done via the use of ENVIRONMENT variables

Environment variable Name Parameter Function Required/Default
DELAY_SECONDS Delay start of the main container by n seconds Default: 0 seconds (Disabled)
EXPECTED_READY_POD_COUNT The number of pods to reach a Ready state before the init container will exit and allow the main container to start Required
NAMESPACE Which namespace to target Required
POD_LABEL A label selector which matches the required pods Required
RANDOM_WINDOW_SECONDS Max seconds for window size Default: 0 seconds (Disabled)
SLEEP_COUNT The time to wait between retries Default: 5 seconds
USE_LOCAL_KUBECONFIG Use a local kubeconfig or not. Defaults to in cluster auth Default: false

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
pkg

Jump to

Keyboard shortcuts

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