Metadata-Version: 2.1
Name: pvcpie
Version: 0.1.2
Summary: Package to get PVC usage information in a cluster
Author: Ujjwal
Author-email: ujjwal@amagi.com
Requires-Python: >=3.9,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: kubernetes (>=30.1.0,<31.0.0)
Requires-Dist: pandas (>=2.2.2,<3.0.0)
Requires-Dist: prettytable (>=3.10.0,<4.0.0)
Requires-Dist: requests (>=2.32.3,<3.0.0)
Description-Content-Type: text/markdown

# Pvcpie
A tool to get pvc usage information from kubernetes for a cluster. It uses [kubernetes nodes metric data](https://kubernetes.io/docs/reference/instrumentation/node-metrics/) to fetch volumes for and calculate their disk usage.

# Usage

You can directly install it from `pip` :
```
pip install pvcpie
```

# Development guide

To run this on your local, clone this repo and run following commands:

1. Install poetry on your local if not present
```
pip install poetry
```

2. Go to project directory and install dependencies using
```
poetry install
```

3. To run on your CLI, run command:
```
poetry run pvcpie
```

or activate poetry shell using `poetry shell`
```
pvcpie
```

If you want to use incluster config instead of kube config use `-i` flag:
```
pvcpie -i
```
or
```
poetry run pvcpie -i
```

or run this in api mode to get the json data. 
```
poetry run pvcpie --api
```
TODO:
[ ] Add a swagger page to get metrics in API mode from cluster

## Customize

To customize it for other requirements, `KubernetesUtils` class can be used. Example:
```
kts= KubernetesUtils()
nodes = kts.list_all_nodes()

    for node in nodes:
        res = kts.get_node_summary(node)
        volumes = kts.get_pvc_summary(res)

```
