Skip to main content

Inventory of softwares running in a Kubernetes cluster

Project description

Kube Inventory

A tool to inventory and track software versions running in Kubernetes clusters, helping identify outdated applications that may need upgrades.

Overview

Kube Inventory scans your Kubernetes cluster to identify running applications and compares their versions against the latest releases available in their GitHub repositories. This helps you quickly assess which applications need updates.

Features

  • Multiple Output Formats: Export inventory data as json, csv or expose via Prometheus metrics
  • GitHub Integration: Automatically fetches latest release information from GitHub repositories
  • Kubernetes Native: Works with standard kubeconfig or in-cluster configuration
  • Custom Application Support: Extend the default application list with custom definitions
  • Prometheus Integration: Expose metrics for monitoring and alerting
  • Web Interface: Built-in web server for Prometheus mode

Utilization

The tool can be run from the command line with various options to customize its behavior or by Kubernetes, and then generating Prometheus metrics for monitoring purposes.

CLI Mode

CLI Mode

You can run Kube Inventory from the command line to generate inventory reports in your desired format. Use the --output-mode flag to specify the format (json or csv).

The installation can be easily done via pip:

pip install kube-inventory

Example command to run Kube Inventory in CLI mode:

kube-inventory

The reports will be saved in the default output directory specified by the argument --output-dir, which defaults to the current directory.

In this sample output, you can see the generation of the report in the csv format:

CSV Output

Prometheus Mode

You can also run Kube Inventory in Prometheus mode, where it exposes the inventory data as metrics via a built-in web server. This allows you to integrate with Prometheus for monitoring and alerting.

You can specify the output mode as prometheus using the --output-mode flag, and them application will start a web server to expose the metrics in Prometheus format.

Prometheus Mode

In case you want to install Kube Inventory in a Kubernetes cluster, you can use the provided Helm chart available in the srekit/helm-charts/kube-inventory,

Helm Chart Installation

You could also have the possibility to visualize the metrics using Grafana dashboards, besides trigger alerts using Prometheus rules.

dashboard_overall_and_coverage

dashboard_details

Command-Line Options

Argument Options Description Default
--extra-apps-file-path Path to YAML file Path to custom applications YAML file None
--github-access-token String GitHub access token for API requests None
--github-api-url URL Base URL for GitHub API https://api.github.com
--kube-config-path Path to kubeconfig file Path to the kubeconfig file to use ~/.kube/config
--kube-in-cluster Boolean Use in-cluster Kubernetes config False
--log-level debug, info, warning, error Logging level for the application info
--output-dir Path to output directory Directory to save output files Current directory
--output-mode json, csv, prometheus Output format for the inventory data json
--output-refresh-interval-seconds Integer (seconds) Refresh interval for Prometheus mode 300
--version Show application version and exit
--web-host Hostname or IP Host for the web server in Prometheus mode 0.0.0.0
--web-port Integer (port number) Port for the web server in Prometheus mode 8080

Environment Variables

The following environment variables can be used as alternatives to command-line arguments:

Environment Variable Description
GITHUB_ACCESS_TOKEN GitHub access token for API requests
LOG_LEVEL Logging level for the application

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

kube_inventory-1.0.1.tar.gz (24.0 kB view details)

Uploaded Source

Built Distribution

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

kube_inventory-1.0.1-py3-none-any.whl (32.5 kB view details)

Uploaded Python 3

File details

Details for the file kube_inventory-1.0.1.tar.gz.

File metadata

  • Download URL: kube_inventory-1.0.1.tar.gz
  • Upload date:
  • Size: 24.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kube_inventory-1.0.1.tar.gz
Algorithm Hash digest
SHA256 dbf7bdc59190fc80cafa327a60707c7b41dc4969a2a1e91bac4ea9f1ff9d7f0c
MD5 065099d5c92e22610690ba88eb87c606
BLAKE2b-256 0b9196e4d04214b9e7eec0bffc3f47f501769dfb3d380fc3e3b7b0161ae05406

See more details on using hashes here.

Provenance

The following attestation bundles were made for kube_inventory-1.0.1.tar.gz:

Publisher: release.yaml on srekit/kube-inventory

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

File details

Details for the file kube_inventory-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: kube_inventory-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 32.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kube_inventory-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c3627e29fb1f2e40a444c84c0c596d7b165a314b54ad8d930facb9fdd15438d4
MD5 358a72cc00afb89cca44b19361b3242b
BLAKE2b-256 2096040497525b49a1a25f13e94986b0da663ecc8503f3faab834aa8d6b9c308

See more details on using hashes here.

Provenance

The following attestation bundles were made for kube_inventory-1.0.1-py3-none-any.whl:

Publisher: release.yaml on srekit/kube-inventory

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