feat(userbot): add Kubernetes control panel
Manage Telegram instances through Kubernetes with legacy adoption for forust and anna. Build and deploy the panel image alongside the runtime.
This commit is contained in:
1 parent
30e6f05584
commit
71cddd6a91
41 files changed
+8268
-21
No files matched your search
@@ -0,0 +1,43 @@
|
||||
# Userbot Control Panel
|
||||
|
||||
Локальная панель управляет userbot-инстансами напрямую через Kubernetes API.
|
||||
Новые аккаунты создаются в namespace `userbot`; существующие `forust` и `anna`
|
||||
остаются в `default` и принимаются под управление только через metadata labels.
|
||||
|
||||
## Первый запуск
|
||||
|
||||
Скопировать общий Secret в новый namespace, не печатая его значения:
|
||||
|
||||
```bash
|
||||
kubectl create namespace userbot --dry-run=client -o yaml | kubectl apply -f -
|
||||
kubectl get secret userbot-common-secrets -n default -o json \
|
||||
| jq 'del(.metadata.annotations,.metadata.creationTimestamp,.metadata.resourceVersion,.metadata.uid,.metadata.managedFields) | .metadata.namespace = "userbot"' \
|
||||
| kubectl apply -f -
|
||||
```
|
||||
|
||||
Затем применить манифесты:
|
||||
|
||||
```bash
|
||||
kubectl apply -f userbot/k8s/base/panel.yaml
|
||||
kubectl apply -f userbot/k8s/base/userbots.yaml
|
||||
kubectl rollout status deployment/userbot-panel -n userbot
|
||||
```
|
||||
|
||||
Панель доступна только через внутренний Traefik route:
|
||||
`https://userbot.workstation.internal`.
|
||||
|
||||
## Локальная разработка
|
||||
|
||||
```bash
|
||||
cd userbot/panel/frontend
|
||||
npm install
|
||||
npm run dev
|
||||
```
|
||||
|
||||
Backend использует in-cluster config, а вне кластера — текущий kubeconfig:
|
||||
|
||||
```bash
|
||||
cd userbot/panel/backend
|
||||
uv run --with-requirements requirements-dev.txt \
|
||||
uvicorn app.main:app --reload --port 8080
|
||||
```
|
||||
Reference in new issue
Block a user