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 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. It supports deployment in an EKS environment and offers features like data aggregation and export.
--- ---
## Features ## Features
- **Metal Nodes**: Track hardware details like CPU, memory, and storage for physical nodes. - **Metal Nodes**: Track hardware details like CPU, memory, and storage for physical nodes. Import node data from JSON file.
- **Virtual Machines**: Monitor VMs from cloud providers like Hetzner. - **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. - **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.
@@ -16,7 +16,7 @@ It supports deployment in an EKS environment and offers features like data aggre
## Project Structure ## Project Structure
```plaintext ```plaintext
metal-check-backend/ metalcheck-backend/
├── app/ ├── app/
│ ├── __init__.py # Initialization │ ├── __init__.py # Initialization
│ ├── main.py # FastAPI entry point │ ├── main.py # FastAPI entry point
@@ -26,10 +26,12 @@ metal-check-backend/
│ │ ├── 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
│ │ ├── export.py # Data export routes │ │ ├── export.py # Data export routes
│ ├── example/k8s/ │ ├── example/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
├── 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
@@ -58,6 +60,7 @@ Apply RBAC and deployment configurations:
```bash ```bash
kubectl apply -f examples/k8s/rbac.yaml kubectl apply -f examples/k8s/rbac.yaml
kubectl apply -f examples/k8s/configmap.yaml
kubectl apply -f examples/k8s/deployment.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 | | GET | /metal/data | Get all physical node data |
| POST | /metal/data | Add a new physical node | | POST | /metal/data | Add a new physical node |
| GET | /vm/data | Get all virtual machine data | | 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 | | POST | /vm/data | Add a new virtual machine |
| GET | /k8s/data | Get Kubernetes cluster information | | 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 | | GET | /export | Export data in JSON or YAML format |

View File

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

View File

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