|
1 |
| -# sv |
| 1 | +# Control Panel |
2 | 2 |
|
3 |
| -Everything you need to build a Svelte project, powered by [`sv`](https://github.com/sveltejs/cli). |
| 3 | +A SvelteKit-based control panel for monitoring and managing various services and platforms. |
4 | 4 |
|
5 |
| -## Creating a project |
| 5 | +## Features |
6 | 6 |
|
7 |
| -If you're seeing this, you've probably already done this step. Congrats! |
| 7 | +### eVault Monitoring |
| 8 | + |
| 9 | +- **Real-time eVault Discovery**: Automatically discovers eVault pods across all Kubernetes namespaces |
| 10 | +- **Pod Information**: Displays comprehensive pod details including status, readiness, restarts, age, IP, and node |
| 11 | +- **Live Logs**: View real-time logs from eVault pods with automatic refresh |
| 12 | +- **Pod Details**: Access detailed pod information including YAML configuration and resource usage |
| 13 | +- **Metrics**: View pod performance metrics (when metrics-server is available) |
| 14 | + |
| 15 | +## Prerequisites |
| 16 | + |
| 17 | +### Kubernetes Access |
| 18 | + |
| 19 | +- `kubectl` must be installed and configured |
| 20 | +- Access to the Kubernetes cluster where eVaults are running |
| 21 | +- Proper RBAC permissions to list and describe pods |
| 22 | + |
| 23 | +### System Requirements |
| 24 | + |
| 25 | +- Node.js 18+ |
| 26 | +- Access to execute `kubectl` commands |
| 27 | + |
| 28 | +## Installation |
| 29 | + |
| 30 | +1. Install dependencies: |
8 | 31 |
|
9 | 32 | ```bash
|
10 |
| -# create a new project in the current directory |
11 |
| -npx sv create |
| 33 | +npm install |
| 34 | +``` |
| 35 | + |
| 36 | +2. Ensure kubectl is configured: |
12 | 37 |
|
13 |
| -# create a new project in my-app |
14 |
| -npx sv create my-app |
| 38 | +```bash |
| 39 | +kubectl cluster-info |
15 | 40 | ```
|
16 | 41 |
|
17 |
| -## Developing |
| 42 | +## Usage |
18 | 43 |
|
19 |
| -Once you've created a project and installed dependencies with `npm install` (or `pnpm install` or `yarn`), start a development server: |
| 44 | +### Development |
20 | 45 |
|
21 | 46 | ```bash
|
22 | 47 | npm run dev
|
23 |
| - |
24 |
| -# or start the server and open the app in a new browser tab |
25 |
| -npm run dev -- --open |
26 | 48 | ```
|
27 | 49 |
|
28 |
| -## Building |
29 |
| - |
30 |
| -To create a production version of your app: |
| 50 | +### Building |
31 | 51 |
|
32 | 52 | ```bash
|
33 | 53 | npm run build
|
34 | 54 | ```
|
35 | 55 |
|
36 |
| -You can preview the production build with `npm run preview`. |
| 56 | +## eVault Monitoring |
| 57 | + |
| 58 | +### Main Dashboard |
| 59 | + |
| 60 | +The main page displays a table of all eVault pods found across your Kubernetes cluster: |
| 61 | + |
| 62 | +- **Name**: Clickable link to detailed pod view |
| 63 | +- **Namespace**: Kubernetes namespace where the pod is running |
| 64 | +- **Status**: Current pod status (Running, Pending, Failed, etc.) |
| 65 | +- **Ready**: Number of ready containers vs total containers |
| 66 | +- **Restarts**: Number of container restarts |
| 67 | +- **Age**: How long the pod has been running |
| 68 | +- **IP**: Pod IP address |
| 69 | +- **Node**: Kubernetes node where the pod is scheduled |
| 70 | + |
| 71 | +### Detailed Pod View |
| 72 | + |
| 73 | +Click on any eVault name to access detailed monitoring: |
| 74 | + |
| 75 | +#### Logs Tab |
| 76 | + |
| 77 | +- Real-time pod logs with automatic refresh |
| 78 | +- Configurable log tail length |
| 79 | +- Terminal-style display for easy reading |
| 80 | + |
| 81 | +#### Details Tab |
| 82 | + |
| 83 | +- Complete pod description from `kubectl describe pod` |
| 84 | +- YAML configuration from `kubectl get pod -o yaml` |
| 85 | +- Resource requests and limits |
| 86 | +- Environment variables and volume mounts |
| 87 | + |
| 88 | +#### Metrics Tab |
| 89 | + |
| 90 | +- CPU and memory usage (requires metrics-server) |
| 91 | +- Resource consumption trends |
| 92 | +- Performance monitoring data |
| 93 | + |
| 94 | +### API Endpoints |
| 95 | + |
| 96 | +#### GET /api/evaults |
| 97 | + |
| 98 | +Returns a list of all eVault pods across all namespaces. |
| 99 | + |
| 100 | +#### GET /api/evaults/[namespace]/[pod]/logs?tail=[number] |
| 101 | + |
| 102 | +Returns the most recent logs from a specific pod. |
| 103 | + |
| 104 | +#### GET /api/evaults/[namespace]/[pod]/details |
| 105 | + |
| 106 | +Returns detailed information about a specific pod. |
| 107 | + |
| 108 | +## Configuration |
| 109 | + |
| 110 | +### eVault Detection |
| 111 | + |
| 112 | +The system automatically detects eVault pods by filtering for pods with names containing: |
| 113 | + |
| 114 | +- `evault` |
| 115 | +- `vault` |
| 116 | +- `web3` |
| 117 | + |
| 118 | +You can modify the filter in `src/routes/api/evaults/+server.ts` to adjust detection criteria. |
| 119 | + |
| 120 | +### Log Tail Length |
| 121 | + |
| 122 | +Default log tail length is 100 lines. This can be configured via the `tail` query parameter. |
| 123 | + |
| 124 | +## Troubleshooting |
| 125 | + |
| 126 | +### No eVaults Found |
| 127 | + |
| 128 | +1. Verify kubectl is configured: `kubectl cluster-info` |
| 129 | +2. Check if eVault pods are running: `kubectl get pods --all-namespaces` |
| 130 | +3. Verify pod names contain expected keywords |
| 131 | +4. Check RBAC permissions for pod listing |
| 132 | + |
| 133 | +### Permission Denied |
| 134 | + |
| 135 | +Ensure your kubectl context has permissions to: |
| 136 | + |
| 137 | +- List pods across namespaces |
| 138 | +- Describe pods |
| 139 | +- Access pod logs |
| 140 | +- View pod metrics (if using metrics-server) |
| 141 | + |
| 142 | +### Metrics Not Available |
| 143 | + |
| 144 | +If the metrics tab shows no data: |
| 145 | + |
| 146 | +1. Verify metrics-server is installed: `kubectl get pods -n kube-system | grep metrics` |
| 147 | +2. Check metrics-server logs for errors |
| 148 | +3. Ensure HPA (Horizontal Pod Autoscaler) is configured if needed |
| 149 | + |
| 150 | +## Security Considerations |
| 151 | + |
| 152 | +- The control panel executes kubectl commands on the server |
| 153 | +- Ensure proper access controls and authentication |
| 154 | +- Consider implementing role-based access control |
| 155 | +- Monitor and audit kubectl command execution |
| 156 | + |
| 157 | +## Contributing |
| 158 | + |
| 159 | +1. Fork the repository |
| 160 | +2. Create a feature branch |
| 161 | +3. Make your changes |
| 162 | +4. Add tests if applicable |
| 163 | +5. Submit a pull request |
| 164 | + |
| 165 | +## License |
37 | 166 |
|
38 |
| -> To deploy your app, you may need to install an [adapter](https://svelte.dev/docs/kit/adapters) for your target environment. |
| 167 | +[Add your license information here] |
0 commit comments