HolmesGPT
HolmesGPT (Robusta, progetto CNCF) è un agente: l’LLM decide quali tool chiamare (kubectl, log, PromQL, Alertmanager), legge i risultati e itera fino a una diagnosi. Richiede un modello con tool calling affidabile: usa qwen2.5:14b-instruct o superiore.
Installazione
Sezione intitolata “Installazione”brew tap robusta-dev/homebrew-holmesgptbrew install holmesgptholmes versionCollegamento a Ollama
Sezione intitolata “Collegamento a Ollama”HolmesGPT usa LiteLLM, che supporta Ollama nativamente:
export OLLAMA_API_BASE=http://localhost:11434ollama pull qwen2.5:14b-instructAlternativa via API OpenAI-compatible (stesso risultato, utile con vLLM):
export OPENAI_API_BASE=http://localhost:11434/v1 OPENAI_API_KEY=ollamaIn quel caso il modello si indica come openai/qwen2.5:14b-instruct.
Configurazione
Sezione intitolata “Configurazione”mkdir -p ~/.holmescat > ~/.holmes/config.yaml <<'EOF2'model: ollama_chat/qwen2.5:14b-instructalertmanager_url: http://localhost:9093toolsets: prometheus/metrics: enabled: true config: prometheus_url: http://localhost:9090EOF2holmes toolset listI toolset Kubernetes (risorse, eventi, log) sono attivi di default.
Domande ad hoc
Sezione intitolata “Domande ad hoc”holmes ask "why is the api deployment in namespace shop-demo restarting?"holmes ask "why does service checkout-svc in shop-demo have no endpoints?"holmes ask "what is wrong in namespace shop-demo? list each root cause with evidence and the kubectl command to fix it"holmes ask "is memory usage of pods in shop-demo close to their limits? use prometheus"Allegare un file al contesto (log applicativo, output di un comando):
kubectl -n shop-demo logs deploy/checkout --tail=200 > /tmp/checkout.logholmes ask "correlate this log with the pod readiness status" -f /tmp/checkout.logRCA sugli alert
Sezione intitolata “RCA sugli alert”Prima genera gli alert con shop-demo e attendi 10–15 minuti.
holmes investigate alertmanager --alertmanager-url http://localhost:9093Opzioni per filtrare alert e limitare il numero di investigazioni:
holmes investigate alertmanager --helpIn-cluster (lab)
Sezione intitolata “In-cluster (lab)”Holmes può girare come servizio HTTP nel cluster. Chart Robusta:
helm repo add robusta https://robusta-charts.storage.googleapis.comhelm repo updatehelm show values robusta/holmes > holmes-default-values.yamlcat > holmes-values.yaml <<'EOF2'additionalEnvVars: - name: OLLAMA_API_BASE value: http://host.docker.internal:11434 - name: MODEL value: ollama_chat/qwen2.5:14b-instructtoolsets: kubernetes/core: enabled: true kubernetes/logs: enabled: true prometheus/metrics: enabled: true config: prometheus_url: http://kps-kube-prometheus-stack-prometheus.monitoring.svc:9090EOF2Confronta le chiavi con holmes-default-values.yaml prima di installare: cambiano tra versioni del chart.
helm upgrade --install holmes robusta/holmes -n holmes --create-namespace -f holmes-values.yamlkubectl -n holmes get pods,svckubectl -n holmes port-forward svc/holmes-holmes 8080:80curl -s localhost:8080/api/chat -H 'Content-Type: application/json' -d '{"ask":"what is wrong in namespace shop-demo?"}' | jq -r '.analysis'Nome del service e schema dell’API dipendono dalla versione: verifica con kubectl -n holmes get svc e la documentazione del chart.
Limiti con modelli locali
Sezione intitolata “Limiti con modelli locali”| Sintomo | Causa | Rimedio |
|---|---|---|
| loop di tool call identiche | modello troppo piccolo | 14B+ o qwen3:14b |
| argomenti inventati (namespace/pod inesistenti) | allucinazione | domande con namespace e nome esplicito |
| risposta troncata | contesto insufficiente | Modelfile con num_ctx 16384 o superiore |
| molto lento | CPU o swap | chiudi altri carichi, vedi risorse |