Krkn-lib

Krkn-lib contains the base kubernetes python functions

PyPI

krkn-lib

Krkn Chaos and resiliency testing tool Foundation Library

Contents

The Library contains Classes, Models and helper functions used in Kraken to interact with Kubernetes, Openshift and other external APIS. The goal of this library is to give to developers the building blocks to realize new Chaos Scenarios and to increase the testability and the modularity of the Krkn codebase.

Packages

The library is subdivided in several Packages under src/krkn_lib

  • ocp: Openshift Integration
  • k8s: Kubernetes Integration
  • elastic: Collection of ElasticSearch functions for posting telemetry
  • prometheus: Collection of prometheus functions for collecting metrics and alerts
  • telemetry:
    • k8s: Kubernetes Telemetry collection and distribution
    • ocp: Openshift Telemetry collection and distribution
  • models: Krkn shared data models
    • k8s: Kubernetes objects model
    • krkn: Krkn base models
    • telemetry: Telemetry collection model
    • elastic: Elastic model for data
  • utils: common functions

Documentation and Available Functions

The Library documentation of available functions is here. The documentation is automatically generated by Sphinx on top of the reStructuredText Docstring Format comments present in the code.

Installation

Git

Clone the repository

git clone https://github.com/krkn-chaos/krkn-lib
cd krkn-lib

Install the dependencies

Krkn lib uses poetry for its dependency management and packaging. To install the proper packages please use:

$ pip install poetry
$ poetry install --no-interaction

Testing your changes

To see how you can configure and test your changes see testing changes