An Experimental Tool, 100% Made with ChatGPT
Note: k8sPulse is a technical experiment built entirely with ChatGPT. It’s not optimized for speed or efficiency and does not replace real-time monitoring solutions like Grafana, New Relic, or Datadog. Instead, it’s designed as a fallback option for emergency scenarios when advanced cloud-native scaling tools (e.g., CAST AI, Karpenter, GKE’s autoscaler) may fail. This tool provides critical insights into a Kubernetes cluster with only
kubectl
access.
k8sPulse is an open-source monitoring tool for emergency scenarios, providing a quick Kubernetes cluster health overview when only kubectl
is available. Leveraging the Python Kubernetes native client and OpenAI, it generates insightful and actionable recommendations to help resolve issues efficiently.
- Fallback Kubernetes Monitoring: Designed for emergencies where only
kubectl
access is possible. - OpenAI-Powered Recommendations: Generates actionable cluster health suggestions using OpenAI's GPT models.
- Native Kubernetes Python Client: Uses Kubernetes Python client for direct and reliable cluster interaction.
kubeconfig
configured and connected to your Kubernetes cluster.python3
to run cli.- OpenAI API key for AI-powered recommendations (optional).
To install k8sPulse using pipx
, run:
pipx install git+https://github.com/raestrada/k8sPulse.git@v0.7.0
This command installs the latest tagged version (v0.7.0
) of k8sPulse.
To install pipx
on Linux or macOS, run:
python3 -m pip install --user pipx
python3 -m pipx ensurepath
Ensure python3
and pip
are installed on your system.
To install pipx
on Windows, use the following command in PowerShell:
python -m pip install --user pipx
python -m pipx ensurepath
After installing pipx
, close and reopen your terminal or run refreshenv
if using the Windows Command Prompt.
Once installed, k8sPulse allows you to generate Kubernetes cluster reports and monitor your environment.
To generate a report with default settings, use:
k8spulse
This command generates a Kubernetes cluster report for the default staging
environment.
-
--env-name
-
Description: Specify the environment name for the report.
-
Default Value:
staging
-
Usage:
k8spulse --env-name production
-
-
--interval
-
Description: Set the interval (in seconds) between report generations.
-
Default Value:
300
(5 minutes) -
Usage:
k8spulse --interval 600
-
-
--use-ai
-
Description: Use OpenAI to generate recommendations based on the report.
-
Usage:
k8spulse --use-ai
-
-
--git-commit
-
Description: Automatically commit and push the generated report to the Git repository.
-
Usage:
k8spulse --git-commit
-
-
--gpt-model
-
Description: Specify which GPT model to use for recommendations.
-
Default Value:
got-4o
-
Usage:
k8spulse --gpt-model got-4o
-
To receive AI-powered recommendations for Kubernetes cluster health:
-
Ensure you have an OpenAI API key set as an environment variable:
export OPENAI_API_KEY=your_openai_api_key_here
-
Run the command with the
--use-ai
flag:k8spulse --use-ai
-
Recommendations will be generated and included in the HTML report.
To enable tracking of Cast.AI events in your k8sPulse reports:
-
Ensure you have a CAST AI API key set as an environment variable:
export CAST_AI_API_KEY=your_cast_ai_api_key_here
-
Set the cluster ID you want to track by exporting it as an environment variable:
export CAST_AI_CLUSTER_ID=your_cluster_id_here
-
The Cast.AI events will be automatically included in your k8sPulse report, providing details about node additions, deletions, and autoscaler actions.
After generating a report, open the generated staging_statistics.html
file in your browser. The report provides a visual overview of the Kubernetes cluster, including metrics, events, and insights.
An index.html
file is automatically generated to list all available reports. This allows easy hosting of reports using GitHub Pages for sharing and quick access.
- Push the generated
index.html
and report files to your GitHub repository. - In your repository settings, go to Settings > Pages.
- Under Source, select the branch and set the folder to
/docs
. - Your reports will now be accessible at your GitHub Pages URL.
Contributions are welcome! Visit our GitHub repository for more details on how to get started and our contributing guidelines.
k8sPulse is open source and available under the MIT License.