Skip to content
/ pgkube Public

A Kubernetes workload statistics exporter that stores data in a PostgreSQL database for analysis and monitoring.

License

Notifications You must be signed in to change notification settings

r2k1/pgkube

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pgkube

pgkube is an open-source Kubernetes workload analyzer that stores and processes data in a PostgreSQL database.

Demo

Features

  • Collects workload information from a Kubernetes cluster and stores it in a PostgreSQL database.
  • Provides a user interface for querying and visualizing the collected data.
  • Allows exporting data in CSV format.

Installation

Option 1. Setting up pgkube with a new PostgreSQL Database

curl https://raw.githubusercontent.com/r2k1/pgkube/main/kube/postgres.yaml --output postgres.yaml
# It's highly recommended to modify postgres.yaml and change default PostgreSQL user, and password before applying it
curl https://raw.githubusercontent.com/r2k1/pgkube/main/kube/pgkube.yaml --output pgkube.yaml
# Modify pgkube.yaml to adjust the namespace and PostgreSQL connection string (DATABASE_URL).
kubectl apply -f postgres.yaml
kubectl apply -f pgkube.yaml

Option 2. Using an existing PostgreSQL Database

pgkube automatically creates the necessary tables in the database. It's recommended to create a separate database or schema specifically for pgkube.

curl https://raw.githubusercontent.com/r2k1/pgkube/main/kube/pgkube.yaml --output pgkube.yaml
# Modify pgkube.yaml to adjust the namespace and PostgreSQL connection string (DATABASE_URL).
kubectl apply -f pgkube.yaml

Check UI

kubectl port-forward -n pgkube svc/pgkube 8080:80

Open http://localhost:8080 in your browser.

Use your favorite tool (such as PgAdmin, DBeaver, Grafana, PowerBI, Tableau, Apache Superset, JetBrains IDE, Redash, etc.) to query the database and analyze the data. You can also use the built-in UI to generate more advanced queries.

A good starting point is:

SELECT * FROM cost_hourly;

About

A Kubernetes workload statistics exporter that stores data in a PostgreSQL database for analysis and monitoring.

Resources

License

Stars

Watchers

Forks

Packages