update(doc): README.md
This commit is contained in:
70
README.md
70
README.md
@@ -1,15 +1,16 @@
|
|||||||
# MetalCheck Backend
|
# MetalCheck Backend
|
||||||
|
|
||||||
MetalCheck is a backend service that provides insights into virtual machines, physical nodes, and Kubernetes clusters.
|
MetalCheck is a backend service that provides insights into virtual machines, physical nodes, and Kubernetes clusters.
|
||||||
It supports deployment in an EKS environment and offers features like data aggregation and export.
|
It supports deployment in an EKS environment and offers features like data aggregation, import from APIs, and data export.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
- **Metal Nodes**: Track hardware details like CPU, memory, and storage for physical nodes. Import node data from JSON file.
|
|
||||||
- **Virtual Machines**: Track virtual machine details like CPU, memory, and storage. Import VM data from an API or JSON file.
|
- **Metal Nodes**: Track hardware details like CPU, memory, and storage for physical nodes. Import node data from JSON files.
|
||||||
|
- **Virtual Machines**: Track virtual machine details like CPU, memory, and storage. Import VM data from Hetzner Cloud API or JSON files.
|
||||||
- **Kubernetes Clusters**: Query Kubernetes clusters to gather node and namespace data.
|
- **Kubernetes Clusters**: Query Kubernetes clusters to gather node and namespace data.
|
||||||
- **Data Export**: Export collected data in JSON or YAML format.
|
- **Data Export**: Export collected data in JSON or YAML format for further processing or visualization.
|
||||||
|
|
||||||
---
|
---
|
||||||
|
|
||||||
@@ -18,24 +19,24 @@ It supports deployment in an EKS environment and offers features like data aggre
|
|||||||
```plaintext
|
```plaintext
|
||||||
metalcheck-backend/
|
metalcheck-backend/
|
||||||
├── app/
|
├── app/
|
||||||
│ ├── __init__.py # Initialization
|
│ ├── __init__.py # Initialization
|
||||||
│ ├── main.py # FastAPI entry point
|
│ ├── main.py # FastAPI entry point
|
||||||
│ ├── database.py # SQLite DB setup and operations
|
│ ├── database.py # SQLite DB setup and operations
|
||||||
│ ├── routes/
|
│ ├── routes/
|
||||||
│ │ ├── __init__.py # Initialization for routes
|
│ │ ├── __init__.py # Initialization for routes
|
||||||
│ │ ├── metal.py # Routes for metal nodes
|
│ │ ├── metal.py # Routes for metal nodes
|
||||||
│ │ ├── vm.py # Routes for virtual machines
|
│ │ ├── vm.py # Routes for virtual machines
|
||||||
│ │ ├── k8s.py # Routes for Kubernetes clusters
|
│ │ ├── k8s.py # Routes for Kubernetes clusters
|
||||||
│ | ├── think.py # Routes for AI summary
|
│ │ ├── think.py # Routes for AI summary
|
||||||
│ │ ├── export.py # Data export routes
|
│ │ ├── export.py # Data export routes
|
||||||
│ ├── example/k8s/
|
│ ├── examples/k8s/
|
||||||
│ │ ├── rbac.yaml # RBAC configuration for Kubernetes
|
│ │ ├── rbac.yaml # RBAC configuration for Kubernetes
|
||||||
│ │ ├── deployment.yaml # Deployment configuration for EKS
|
│ │ ├── deployment.yaml # Deployment configuration for EKS
|
||||||
| | ├── configmap.yaml # ConfigMap for EKS
|
│ │ ├── configmap.yaml # ConfigMap for EKS
|
||||||
├── Dockerfile # Docker container configuration
|
├── Dockerfile # Docker container configuration
|
||||||
├── requirements.txt # Python dependencies
|
├── requirements.txt # Python dependencies
|
||||||
├── .dockerignore # Files to ignore during image build
|
├── .dockerignore # Files to ignore during image build
|
||||||
└── README.md # Project documentation
|
└── README.md # Project documentation
|
||||||
```
|
```
|
||||||
|
|
||||||
# Setup and Deployment
|
# Setup and Deployment
|
||||||
@@ -97,3 +98,32 @@ The `/k8s/data` endpoint retrieves information about:
|
|||||||
| GET | /k8s/data | Get Kubernetes cluster information |
|
| GET | /k8s/data | Get Kubernetes cluster information |
|
||||||
| GET | /think/k8s | Get AI summary for Kubernetes cluster |
|
| GET | /think/k8s | Get AI summary for Kubernetes cluster |
|
||||||
| GET | /export | Export data in JSON or YAML format |
|
| GET | /export | Export data in JSON or YAML format |
|
||||||
|
|
||||||
|
## Hetzner Integration
|
||||||
|
To fetch virtual machines from Hetzner Cloud:
|
||||||
|
|
||||||
|
1. Ensure your Hetzner API token is available as an environment variable:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
export HETZNER_TOKEN=<your-token>
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Use the /vm/import-hetzner endpoint:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
curl http://<EXTERNAL-IP>/vm/import_hetzner
|
||||||
|
```
|
||||||
|
|
||||||
|
## Data Export
|
||||||
|
|
||||||
|
1. Export in YAML format:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
curl -X GET "http://<EXTERNAL-IP>/export?format=yaml"
|
||||||
|
```
|
||||||
|
|
||||||
|
2. Export in JSON format:
|
||||||
|
|
||||||
|
```shell
|
||||||
|
curl -X GET "http://<EXTERNAL-IP>/export?format=json"
|
||||||
|
```
|
||||||
|
|||||||
Reference in New Issue
Block a user