https://github.com/zvdy/kube-classify
https://github.com/zvdy/kube-classify
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/zvdy/kube-classify
- Owner: zvdy
- License: mit
- Created: 2025-07-20T07:25:33.000Z (11 months ago)
- Default Branch: main
- Last Pushed: 2025-07-20T11:25:46.000Z (11 months ago)
- Last Synced: 2025-08-26T03:49:15.119Z (10 months ago)
- Language: Python
- Size: 5.86 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Kubectl Infra Classifier
Classifies if a kubectl command modifies infrastructure (yes/no).
## Features
- Detects if a kubectl command is modifying ("yes") or non-modifying ("no")
- Handles real-world, piped, and complex kubectl command scenarios
- Designed for extensibility and production use
## Installation
```sh
pip install .
# or with build isolation
pip install --use-pep517 .
```
## Usage
### As a Python package
```python
from kube_classify.utils import load_model
model = load_model("models/kubectl_classifier.joblib")
result = model.predict(["kubectl apply -f deployment.yaml"])
print("yes" if result[0] == 1 else "no")
```
### Training
Train a new model with your dataset:
```sh
make train
```
## Makefile Commands
- `make install` — Install the package in editable mode for development
- `make train` — Train the model (ensures correct PYTHONPATH)
- `make test` — Run the test suite
- `make lint` — Lint the codebase with flake8
- `make clean` — Remove model artifacts and cache files
## Project Structure
- `src/kube_classify/` — Main package code
- `data/` — Training data
- `models/` — Saved models
- `tests/` — Test suite
## License
MIT