Tool for testing and debugging Kubernetes events/changes in real time
Project description
Salmorejo
Salmorejo is a command line tool which will help you to run your own Python scripts in order to test, debug and/or analyze the status of your Kubernetes cluster in real time.
Salmorejo is under heavy development
How does it work?
Salmorejo will connect to your "current-connected" Kubernetes cluster (check $ kubectl cluster-info
) and it will received changes in the desired objects. These events will be forwarded to your custom Python script.
Your python script must contain a function call callback
which has the argument event
. Every event will contain 3 main fields:
- 'type': The type of event such as "ADDED", "DELETED", etc.
- 'raw_object': a dict representing the watched object.
- 'object': A model representation of raw_object. The name of model will be determined based on the func's doc string. If it cannot be determined, 'object' value will be the same as 'raw_object'.
Event information has been defined by the kubernetes library.
Supported Objects
Currently, Salmorejo supports:
- Deployments ("deployments", "deployment")
- Pods ("pods", "pod", "po")
- Services ("services", "service", "svc")
Installation
From Pypi
$ python -m pip install salmorejo
From Code
$ python -m pip install -e .
How to use it?
CLI
$ salmorejo watch <python script path> <comma-separated-list of kubernetes objects>
From Code repository
$ python main.py watch <python script path> <comma-separated-list of kubernetes objects>
Example
$ salmorejo watch ./scripts/counter.py pod,svc,deployments
+------------+--------------------+-------+
| KIND | NAMESPACE | COUNT |
+------------+--------------------+-------+
| Service | default | 2 |
+------------+--------------------+-------+
| Deployment | kube-system | 1 |
+------------+--------------------+-------+
| Pod | kube-system | 8 |
+------------+--------------------+-------+
| Deployment | local-path-storage | 1 |
+------------+--------------------+-------+
| Service | kube-system | 1 |
+------------+--------------------+-------+
| Pod | local-path-storage | 1 |
+------------+--------------------+-------+
| Pod | default | 4 |
+------------+--------------------+-------+
Examples
Examples of Scripts can be found under here
What actually is Salmorejo?
Salmorejo is a traditional Andalusian food, originally from Córdoba. Wiki.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for salmorejo-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9cd21bfa26b3426f25d3ccbcd4ca5701964da98c3d419907a69e51bed3c7463e |
|
MD5 | 076413c84d47eda3cdeb9c188c8176ed |
|
BLAKE2b-256 | 612285bd6c9c6b675acc3b3ebcb96cda192acf29e3d82a3553b030f5f621bd76 |