Files
obsidian-sympozium/03-CRD/SympoziumInstance.md
2026-03-25 00:05:57 +01:00

120 lines
3.0 KiB
Markdown

# SympoziumInstance
#sympozium #crd #instance
## Definicja
`SympoziumInstance` to centralny CRD reprezentujący **jednego tenanta/użytkownika**. Deklaruje konfigurację kanałów, agentów, skillów, polityk i memory.
**Plik:** `api/v1alpha1/sympoziuminstance_types.go`
## Spec
```yaml
apiVersion: sympozium.ai/v1alpha1
kind: SympoziumInstance
metadata:
name: my-agent
spec:
channels: # Podłączone kanały
- type: telegram
configRef:
secret: telegram-creds
accessControl:
allowedSenders: ["123456"]
agents:
default:
model: gpt-4.1
baseURL: "" # Override dla OpenAI-compat
thinking: "medium" # off/low/medium/high
sandbox:
enabled: false
agentSandbox: # Kernel-level isolation
enabled: true
runtimeClass: gvisor
warmPool:
size: 3
subagents:
maxDepth: 2
maxConcurrent: 5
maxChildrenPerAgent: 3
nodeSelector: # Pinning do GPU node'ów
gpu-type: "a100"
skills: # SkillPacks do montowania
- skillPackRef: k8s-ops
params:
CLUSTER: production
- skillPackRef: memory
policyRef: restrictive # Polityka bezpieczeństwa
authRefs: # Klucze API
- provider: openai
secret: openai-key
memory: # Legacy ConfigMap memory
enabled: true
maxSizeKB: 256
observability: # OpenTelemetry
enabled: true
otlpEndpoint: "otel-collector.observability.svc:4317"
mcpServers: # External tool providers
- name: github
toolsPrefix: gh
timeout: 30
```
## Status
```yaml
status:
phase: Running|Serving|Pending|Error
channels:
- type: telegram
status: Connected|Disconnected|Error
activeAgentPods: 2
totalAgentRuns: 150
webEndpoint:
status: Ready
url: "alice.sympozium.example.com"
```
## Kluczowe koncepty
### Multi-tenancy
Każda SympoziumInstance to osobny tenant z:
- Własnymi kanałami
- Własnymi credentials (AuthRefs)
- Własną polityką
- Własną memory
- Własnymi MCP serverami
### Reconciliation
`SympoziumInstanceReconciler` zarządza:
1. **Channel Deployments** - tworzy/aktualizuje Deployment per kanał
2. **Memory ConfigMap** - legacy `<name>-memory` ConfigMap
3. **Memory PVC** - SQLite DB dla memory SkillPack
4. **Memory Deployment** - memory-server Deployment + Service
5. **Web Endpoints** - server-mode AgentRun dla web-endpoint skill
### Finalizery
Przy usunięciu instancji controller:
- Czyści channel deployments
- Czyści memory ConfigMap
- Czyści memory deployment
### Channel Access Control
Kanały mogą ograniczać kto może komunikować się z agentem:
- `allowedSenders` - whitelist ID nadawców
- `deniedSenders` - blacklist (nadpisuje whitelist)
- `allowedChats` - whitelist ID czatów/grup
- `denyMessage` - wiadomość dla odrzuconych
---
Powiązane: [[AgentRun]] | [[PersonaPack]] | [[SympoziumPolicy]] | [[Kanały - Telegram Slack Discord WhatsApp]]