Internals

Connectors

class kubemen.connectors.base.Connector(environment, annotations)[source]

Base class for all connectors

Connectors must implement the send() method.

Any option related to this connector found in the environment or in the annotations will be added as an attribute of the instance itself, and thus accesible throught self inside send() (or any other method).

Only environment variables and annotations that are prefixed with the connector’s name are taken into account. Since both environment variables and annotations can only be represented as strings, their values are automatically casted in the type defined by the default value in config.py (or kept as string if their is no default value).

For example, a Foo connector can be configured through the environment with the FOO_ prefix. FOO_BAR_BAZ=1 would result in Foo().bar_baz` being 1, as integer or string depending on the default value in config.py. Then it could be overriden later with an annotation of a watched resource: kubemen.numberly.com/foo.bar-baz: 1.

Parameters:
  • environment (dict) – Environment variables that might configure this connector
  • annotations (dict) – Annotations that might configure this connector
send(change, character, user)[source]
Parameters:
  • change (Change) – What changed on Kubernetes
  • character (Character) – A random Watchmen character
  • user (User) – The user that modified the resource
class kubemen.connectors.mattermost.Mattermost(environment, annotations)[source]
send(change, character, user)[source]
Parameters:
  • change (Change) – What changed on Kubernetes
  • character (Character) – A random Watchmen character
  • user (User) – The user that modified the resource
class kubemen.connectors.email.Email(environment, annotations)[source]
send(change, character, user)[source]
Parameters:
  • change (Change) – What changed on Kubernetes
  • character (Character) – A random Watchmen character
  • user (User) – The user that modified the resource

Models

class kubemen.models.Change[source]
annotations
diff
images
kind
name
namespace
object
operation
username
class kubemen.models.Character[source]
icon_filename
class kubemen.models.User[source]