update(doc): README.md and examples

This commit is contained in:
Aleksandr Tcitlionok
2024-12-09 03:38:25 +00:00
parent dc66d5a33e
commit f7a72612d9
3 changed files with 14 additions and 8 deletions

View File

@@ -1,13 +1,13 @@
# MetalCheck Backend
MetalCheck is a backend service that provides real-time 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.
---
## Features
- **Metal Nodes**: Track hardware details like CPU, memory, and storage for physical nodes.
- **Virtual Machines**: Monitor VMs from cloud providers like Hetzner.
- **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.
- **Kubernetes Clusters**: Query Kubernetes clusters to gather node and namespace data.
- **Data Export**: Export collected data in JSON or YAML format.
@@ -16,7 +16,7 @@ It supports deployment in an EKS environment and offers features like data aggre
## Project Structure
```plaintext
metal-check-backend/
metalcheck-backend/
├── app/
│ ├── __init__.py # Initialization
│ ├── main.py # FastAPI entry point
@@ -26,10 +26,12 @@ metal-check-backend/
│ │ ├── metal.py # Routes for metal nodes
│ │ ├── vm.py # Routes for virtual machines
│ │ ├── k8s.py # Routes for Kubernetes clusters
│ | ├── think.py # Routes for AI summary
│ │ ├── export.py # Data export routes
│ ├── example/k8s/
│ │ ├── rbac.yaml # RBAC configuration for Kubernetes
│ │ ├── deployment.yaml # Deployment configuration for EKS
| | ├── configmap.yaml # ConfigMap for EKS
├── Dockerfile # Docker container configuration
├── requirements.txt # Python dependencies
├── .dockerignore # Files to ignore during image build
@@ -58,6 +60,7 @@ Apply RBAC and deployment configurations:
```bash
kubectl apply -f examples/k8s/rbac.yaml
kubectl apply -f examples/k8s/configmap.yaml
kubectl apply -f examples/k8s/deployment.yaml
```
@@ -89,6 +92,8 @@ The `/k8s/data` endpoint retrieves information about:
| GET | /metal/data | Get all physical node data |
| POST | /metal/data | Add a new physical node |
| GET | /vm/data | Get all virtual machine data |
| GET | /vm/import_hetzner | Import VM data from Hetzner API |
| POST | /vm/data | Add a new virtual machine |
| GET | /k8s/data | Get Kubernetes cluster information |
| GET | /think/k8s | Get AI summary for Kubernetes cluster |
| GET | /export | Export data in JSON or YAML format |

View File

@@ -1,8 +1,9 @@
apiVersion: v1
kind: ConfigMap
metadata:
name: ai-api-config
name: api-config
namespace: metalcheck
data:
AI_API_URL: "<URL>"
AI_API_TOKEN: "<TOKEN>"
AI_API_URL: ""
AI_API_TOKEN: ""
HETZNER_TOKEN: ""

View File

@@ -20,7 +20,7 @@ spec:
image: <your-ecr-repo>:latest
envFrom:
- configMapRef:
name: ai-api-config
name: api-config
ports:
- containerPort: 8000
env: