kubejyg: Kubernetes Resource Extraction with Namespace Grouping built for filtering with jq, yq and grep.
Project description
Kubejyg
Kubernetes Resource Extraction with Namespace Grouping.
How it works
kubejyg extracts Kubernetes resources across multiple namespaces, grouping them by namespace. The output is generated in either JSON or YAML, ready to be piped into well known processors like jq, yq, and grep.
Examples
Fetch all deployment manifests from all namespaces in YAML.
kubejyg | yq ".Namespaces.[].[].[].Deployments" -C
Fetch all the annotations from all the Services across all Namespaces in JSON.
kubejyg -o json | jq ".Namespaces[].[].[].Services | select ( . != null) | .[].metadata.annotations" -C
Output structure
{
"Namespaces": [
{
"ns-1": [
{
"Deployments": [
{
deployment-manifest-1
}
...
]
"Services": [
{
service-manifest-1
}
...
]
"Ingress": [
{
ingress-manifest-1
}
...
]
}
]
...
}
]
}
Installation
pip install kubejyg
Features
Kubernetes resources:
- Deployments
- Services
- Ingresses
Output:
- YAML
- JSON
Naming
kubejyg is named after the following utilities:
kubectljqyqgrep
Gotchas
jq: error (at <stdin>:1): Cannot iterate over null (null).
Some namespaces might not contain resources of all kinds. If we apply filters over empty arrays, jq and yq will replaces those arrays with null values. Applying filters over them will error out. Use select ( . != null) to filter null expressions, see examples for details.
Contributing
- Create an issue
- Fork
- Change
- Open PR
- Profit!
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kubejyg-0.0.12.tar.gz.
File metadata
- Download URL: kubejyg-0.0.12.tar.gz
- Upload date:
- Size: 16.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51c4479a16ae9480e5c00ae90b957b184e9d50a9b4e1ea73c63184b528c6e58b
|
|
| MD5 |
af8d612e0b15bde818c561f66a63d77e
|
|
| BLAKE2b-256 |
0fa126303a435a987727c0f59e06a501e10243d95998028af3979f8cfdf113f2
|
File details
Details for the file kubejyg-0.0.12-py3-none-any.whl.
File metadata
- Download URL: kubejyg-0.0.12-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.0.1 CPython/3.10.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
463a176b6ca2c0c58cf7ff15a81ea1d5e0a8eec38d87520fbc09d4c2d897e460
|
|
| MD5 |
2e72a839bac8af90e513438a8a94c888
|
|
| BLAKE2b-256 |
3b5fa2d169ddb012960958cc8d3f4d9872327344d669d51371fe72cc1da3808c
|