diff --git a/README.md b/README.md index 52c6812..7be40e4 100644 --- a/README.md +++ b/README.md @@ -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 | diff --git a/examples/k8s/configmap.yaml b/examples/k8s/configmap.yaml index 7ca9250..3a02e7f 100644 --- a/examples/k8s/configmap.yaml +++ b/examples/k8s/configmap.yaml @@ -1,8 +1,9 @@ apiVersion: v1 kind: ConfigMap metadata: - name: ai-api-config + name: api-config namespace: metalcheck data: - AI_API_URL: "" - AI_API_TOKEN: "" + AI_API_URL: "" + AI_API_TOKEN: "" + HETZNER_TOKEN: "" diff --git a/examples/k8s/deployment.yaml b/examples/k8s/deployment.yaml index 27d2ee6..bad5637 100644 --- a/examples/k8s/deployment.yaml +++ b/examples/k8s/deployment.yaml @@ -20,7 +20,7 @@ spec: image: :latest envFrom: - configMapRef: - name: ai-api-config + name: api-config ports: - containerPort: 8000 env: