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:
- Configmaps ("configmap", "configmaps", "cm")
- Daemonsets ("daemonset", "daemonsets", "ds")
- Deployments ("deployments", "deployment")
- Ingresses ("ingress", "ingresses", "ing")
- Pods ("pods", "pod", "po")
- Secrets ("secret", "secrets")
- Services ("services", "service", "svc")
- Statefulsets ("statefulset", "statefulsets", "sts")
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
Why Python
Although Go is the lingua franca to code against Kubernetes, Python could be considered the most used programming language by SysAdmins, SREs or Platform Engineers. Salmorejo was thought for this kind of people, and we hope that they enjoy it.
What actually is Salmorejo?
Salmorejo is a traditional Andalusian food, originally from Córdoba. Wiki.
Metadata
Release files for salmorejo 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| salmorejo-0.2.0.tar.gz | 9.8 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| salmorejo-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 20.8 kB
Release files / salmorejo-0.2.0.tar.gz
| Download URL | salmorejo-0.2.0.tar.gz |
|---|---|
| Size | 9.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
220a4f9e5c71bb1d1b27861c1ceede4bdf83c70bef9878d4d2c9eca38a3c1ad2
|
|
BLAKE2b-256 checksum How to use checksums |
209eb4919a81221a32c6f2b4d77ec1d98e0ff0c8ecaeb769214a44ec7c5005fd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|
Release files / salmorejo-0.2.0-py3-none-any.whl
| Download URL | salmorejo-0.2.0-py3-none-any.whl |
|---|---|
| Size | 11.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
1b5cd7c70a7bebe7c2d4a8d6e5702b2955b3324673e4ddd494abf5ef73695681
|
|
BLAKE2b-256 checksum How to use checksums |
f446686f65084ce797163de2155efad8552f9259d6955fe871f1894085e136a3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.10.6
|