96de2d2573
Manage Telegram instances through Kubernetes with legacy adoption for forust and anna. Build and deploy the panel image alongside the runtime.
44 lines
1.5 KiB
Markdown
44 lines
1.5 KiB
Markdown
# 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
|
||
```
|