Skip to main content

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 deployment manifests across all namespaces in YAML and filter nulls.

kubejyg | yq ".Namespaces[].[].[].Deployments | select ( . != null ) | .[]" -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:

  1. kubectl
  2. jq
  3. yq
  4. grep

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

  1. Create an issue
  2. Fork
  3. Change
  4. Open PR
  5. Profit!

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

kubejyg-0.2.17.tar.gz (16.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kubejyg-0.2.17-py3-none-any.whl (17.5 kB view details)

Uploaded Python 3

File details

Details for the file kubejyg-0.2.17.tar.gz.

File metadata

  • Download URL: kubejyg-0.2.17.tar.gz
  • Upload date:
  • Size: 16.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for kubejyg-0.2.17.tar.gz
Algorithm Hash digest
SHA256 1c630f4dea6ee3d7bd404f886f614768472d0601eb9b82bd5eade3c98d91ffb2
MD5 8d81a562b258300999b295e7bfba6c8f
BLAKE2b-256 c62dfa6b799723f8b856d7c47c4d0d6bdbd41f587de605c97cd245c26024f39d

See more details on using hashes here.

Provenance

The following attestation bundles were made for kubejyg-0.2.17.tar.gz:

Publisher: publish.yml on petrousoft/kubejyg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kubejyg-0.2.17-py3-none-any.whl.

File metadata

  • Download URL: kubejyg-0.2.17-py3-none-any.whl
  • Upload date:
  • Size: 17.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for kubejyg-0.2.17-py3-none-any.whl
Algorithm Hash digest
SHA256 21f11d2584a1c7b21db87a2b99cf16a56c9e8f37fb10158f964414949883bf77
MD5 fad68979e5599d41bb482cf15e6adc30
BLAKE2b-256 53bb7abdc4cfc882d898b75a4f947d33d47cf013900d4b2229dd325d80e68afb

See more details on using hashes here.

Provenance

The following attestation bundles were made for kubejyg-0.2.17-py3-none-any.whl:

Publisher: publish.yml on petrousoft/kubejyg

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page