Logo di K8s Grafana Troubleshooting

K8s Grafana Troubleshooting

Organizzazione
k8s-servant
k8s-grafana-troubleshooting

Usa questa skill quando Grafana su Kubernetes non funziona: il pod Grafana entra in un ciclo di crash dopo una modifica al provisioning ("Datasource provisioning error", "Only one datasource per organization can be marked as default", "failed to parse"), una dashboard o un datasource configurato tramite provisioning non compare ("failed to load dashboard from", etichette ConfigMap del sidecar), i pannelli mostrano "No data" o il datasource restituisce "Bad Gateway" o "connection refused", compare "database is locked" con più repliche, ci sono errori di autorizzazione sul volume dati, l'accesso amministratore o il sidecar restituisce "401 Unauthorized" oppure le risorse di grafana-operator riportano "NoMatchingInstance". Esegue le verifiche con kubectl get, describe, events e logs, senza mai leggere i Secrets di Grafana, quindi propone delle soluzioni. Prima analizza e poi chiede prima di apportare modifiche.

Panoramica

Pubblicato dak8s-servant
Repositoryk8s-skills
Nome della skillk8s-grafana-troubleshooting
Stelle
36
Fork
7
File inclusi
3
LicenzaApache-2.0
Link
  • Istruzioni in Markdown

    Un file SKILL.md che il modello carica quando serve, consumando token solo quando una richiesta è effettivamente pertinente.

  • Funziona con qualsiasi LLM

    Le skill IA sono in semplice Markdown, non in codice specifico di un fornitore, quindi funzionano con GPT, Claude, Gemini, Grok o un modello locale.

  • File inclusi: 3

    Script, template e riferimenti che il modello può leggere mentre lavora. I file sono di sola lettura e non vengono mai eseguiti.

  • Open source

    Pubblicata da k8s-servant su GitHub. Leggi i sorgenti prima di installarla.

Installazione

Installa la skill IA K8s Grafana Troubleshooting in TypingMind per usarla con qualsiasi LLM, oppure copiala in un altro agente in grado di leggere SKILL.md.

1

Installa in TypingMind

TypingMind installa una skill direttamente dalla sua cartella GitHub: legge SKILL.md, raccoglie i file delle risorse e salva il risultato in locale.

  1. Apri l'app e vai su Plugin → Skill.
  2. Scegli "Installa da GitHub".
  3. Incolla l'URL della cartella della skill riportato qui sotto e conferma.
    https://github.com/k8s-servant/k8s-skills/tree/main/skills/k8s-grafana-troubleshooting
  4. Attiva la skill in ogni chat in cui vuoi averla a disposizione.
Plugin → Skill → Aggiungi skill → Da URL GitHub, poi incolla l'URL della cartella e premi Continua.
2

Installa in un altro agente

Qualsiasi agente che legge il formato Agent Skills può usare questa skill: copia la cartella della skill nella directory delle skill di quell'agente.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/k8s-servant/k8s-skills.git /tmp/k8s-skills
mkdir -p .claude/skills
cp -r /tmp/k8s-skills/skills/k8s-grafana-troubleshooting .claude/skills/k8s-grafana-troubleshooting
Dopo la copia, riavvia Claude Code per caricare la nuova skill.

Usala in TypingMind

Attiva K8s Grafana Troubleshooting in qualsiasi chat di TypingMind e al resto pensa il modello. Il nome e la descrizione della skill sono nel prompt di sistema e, non appena arriva una richiesta pertinente, il modello carica da solo le istruzioni complete: non devi mai richiamarla manualmente e non consuma token finché non viene effettivamente usata.

Il modello carica automaticamente K8s Grafana Troubleshooting non appena riceve una richiesta pertinente.

Funziona con qualsiasi modello IA

Le skill IA sono semplici istruzioni in Markdown, non codice specifico di un fornitore, quindi K8s Grafana Troubleshooting non è vincolata al modello per cui è stata scritta. Installala una sola volta in TypingMind e usala con GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama o un modello locale che esegui tu, sempre con le tue chiavi API.

  • Caricata solo quando serve

    Il prompt di sistema contiene solo il nome e la descrizione. Le istruzioni vengono recuperate alla prima richiesta pertinente, quindi una skill inutilizzata non costa nulla.

  • Cambia modello durante la chat

    Poiché la skill è composta da istruzioni e non da codice, continua a funzionare anche se cambi modello: il nuovo modello legge lo stesso file SKILL.md.

Istruzioni della skill

Questo è il contenuto di SKILL.md che il modello carica. Leggilo prima dell'installazione: una skill è un insieme di istruzioni che il tuo modello seguirà.

Grafana troubleshooting

Find out why Grafana does not start, does not show a datasource or dashboard, or shows no data, and propose a fix. Read first, ask before changing. Run the investigation commands freely. Run a command under an "Ask first" line only after the user approves that exact command; if your credentials do not allow it, give it to the user to run. Never run a "Proposed fix"; hand it to the user.

On Kubernetes, Grafana is usually provisioned: datasources and dashboard providers are YAML files under /etc/grafana/provisioning/, and dashboards are JSON files, all mounted from ConfigMaps. With the Grafana Helm chart (also inside kube-prometheus-stack) a sidecar container copies ConfigMaps labelled grafana_dashboard or grafana_datasource into the pod. With the grafana-operator, Grafana, GrafanaDashboard and GrafanaDatasource resources do the same.

The commands use placeholders: monitoring (where Grafana runs), my-grafana (its Deployment and Service), my-grafana-datasources and my-grafana-dashboards (its ConfigMaps) and my-app (a dashboard). Replace them with the real names.

Never read Secrets: not the admin password, not datasource credentials, not grafana.ini values kept in Secrets. The sidecar can also read Secrets with the same labels; look only at ConfigMaps. Do not log in to Grafana's API with the admin password; its /api/health needs no login.

When to use

  • The Grafana pod is in CrashLoopBackOff or not Ready, often right after a change.
  • A provisioned datasource or dashboard is missing in the UI.
  • Panels show "No data", or a datasource test fails.
  • Logins fail, or the sidecar logs 401 Unauthorized.
  • grafana-operator resources do not sync.

Hand-offs, by skill name. When the evidence points elsewhere, continue with that skill; if it is not installed, keep going with the steps here and tell the user which skill would help:

  • Grafana runs and reaches Prometheus, but Prometheus has no data for the query: k8s-prometheus-troubleshooting.
  • The datasource's Service exists but traffic does not reach it (NetworkPolicy, DNS): k8s-network-troubleshooting.
  • The pod is Pending or its volume does not mount: k8s-workload-troubleshooting, k8s-storage-troubleshooting.

Investigate

Work through the steps in order. Stop when you have the cause and its evidence.

1. See the pods. During a rollout the old pod can keep running while the new one crashes; look at each pod, not only the Deployment.

bash
kubectl get deployments,pods -n monitoring -l app=my-grafana -o wide
kubectl get pods -n monitoring -l app=my-grafana -o jsonpath='{range .items[*]}{.metadata.name}{" "}{.status.phase}{"\n"}{range .status.containerStatuses[*]}{"  "}{.name}{" ready="}{.ready}{" restarts="}{.restartCount}{" last="}{.lastState.terminated.reason}{"\n"}{end}{end}'
kubectl events -n monitoring

Avoid kubectl describe pod here: it prints the containers' environment values, and Grafana pods often carry passwords there. If you see a credential anyway, do not repeat it.

The chart labels its pods app.kubernetes.io/name=grafana; use that selector there.

2. Read the logs of the failing pod, the previous run if it restarted. Each pod has the grafana container, and with the chart one container per sidecar (grafana-sc-dashboard, grafana-sc-datasources).

bash
kubectl logs -n monitoring my-grafana-0 -c grafana --previous --tail=50
kubectl logs -n monitoring deployment/my-grafana -c grafana --tail=200 | grep -E "level=error|level=warn|Error:"
kubectl logs -n monitoring deployment/my-grafana -c grafana --tail=500 | grep logger=provisioning

Replace my-grafana-0 with the failing pod's name from step 1.

3. Read the provisioning ConfigMaps the pod mounts.

bash
kubectl get deployment my-grafana -n monitoring -o jsonpath='{range .spec.template.spec.volumes[*]}{.name}{" "}{.configMap.name}{"\n"}{end}'
kubectl get configmap my-grafana-datasources -n monitoring -o yaml
kubectl get configmaps -n monitoring -l grafana_dashboard
kubectl get configmaps -n monitoring -l grafana_datasource

4. For "No data" or a failing datasource, check the address it uses against the Services that exist.

bash
kubectl get services -A | grep -i -E "prometheus|loki|tempo"
kubectl get endpointslices -n monitoring
kubectl get --raw '/api/v1/namespaces/monitoring/services/my-grafana:http/proxy/api/health'

The last command needs get on services/proxy; if it is forbidden, skip it.

5. Open the matching reference and follow its steps:

What you seeReference
CrashLoopBackOff, Datasource provisioning error, failed to parse, a datasource or dashboard missing, sidecar not picking up ConfigMapsreferences/provisioning.md
"No data", Bad Gateway, connection refused, wrong datasource UID in a dashboardreferences/datasources-no-data.md
database is locked, permission errors, plugins, login and 401 Unauthorized, grafana-operator NoMatchingInstancereferences/runtime-and-operator.md

Read the results

What the common findings mean (Grafana 13.2):

  • The new pod exits with Error: ✗ invalid service state: Failed ... Datasource provisioning error: <reason>: Grafana refuses a provisioned datasource file and stops; the pod crash-loops. datasource.yaml config is invalid. Only one datasource per organization can be marked as default means two datasources have isDefault: true. A YAML error or an unknown field shows up the same way.
  • logger=provisioning.dashboard ... level=error msg="failed to load dashboard from " file=<path> error=<JSON error>: that dashboard file is not valid JSON. Grafana skips it and keeps running, so only that dashboard is missing.
  • the same UID is used more than once or dashboard title is not unique in folder: two files define the same dashboard; only one wins.
  • A datasource whose URL names a Service that does not exist (or the wrong port): Grafana starts normally; every query fails, shown in the UI as "Bad Gateway" or a connection error, and in the log only when a query runs.
  • /api/health returns "database": "ok": Grafana itself is up; failing (HTTP 503) means its database is not reachable.

State the cause in one sentence, then the evidence you saw (the log line, the ConfigMap entry, the Services), then the proposed fix.

Proposed fix

Show each fix to the user before running it: what it changes and how to undo it. Provisioning lives in ConfigMaps that come from a Helm chart, kube-prometheus-stack values or a GitOps repository: fix it there. Patching a ConfigMap that only holds provisioning or dashboards, and restarting Grafana to reload it, are reversible, so they go under "Ask first" and run only after the user says yes. Anything with Secrets (admin password, datasource credentials), Grafana's database, its volume and the replica count are never run by you: hand them to the user as proposed fixes. Write each undo with the values you found.

Restart Grafana after its provisioning ConfigMap is fixed (Grafana reads datasource files only at start):

Ask first: the agent runs this only after the user approves it.

bash
kubectl rollout restart deployment/my-grafana -n monitoring
# Undo: kubectl rollout undo deployment/my-grafana -n monitoring

Sources

Checked against the Grafana 13.2 documentation and source (v13.2.4), the Grafana Helm chart 14.0 and grafana-operator 5.25:

File inclusi

Il modello legge questi file quando servono, mentre la skill è caricata. Sono accessibili in sola lettura e non vengono mai eseguiti.

Domande frequenti

Cosa fa la skill IA K8s Grafana Troubleshooting?

Usa questa skill quando Grafana su Kubernetes non funziona: il pod Grafana entra in un ciclo di crash dopo una modifica al provisioning ("Datasource provisioning error", "Only one datasource per organization can be marked as default", "failed to parse"), una dashboard o un datasource configurato tramite provisioning non compare ("failed to load dashboard from", etichette ConfigMap del sidecar), i pannelli mostrano "No data" o il datasource restituisce "Bad Gateway" o "connection refused", compare "database is locked" con più repliche, ci sono errori di autorizzazione sul volume dati, l'acce...

Perché usare K8s Grafana Troubleshooting su TypingMind?

Perché la installi una volta e la usi con qualsiasi modello. K8s Grafana Troubleshooting è scritta in semplice Markdown anziché in codice specifico di un fornitore, quindi la stessa skill funziona con GPT-5, Claude, Gemini, Grok o un modello locale, e puoi cambiare modello durante la chat senza che la skill smetta di funzionare. TypingMind usa le tue chiavi API, quindi paghi direttamente i fornitori anziché un abbonamento per posto utente, e le tue skill e chat restano nel tuo spazio di archiviazione.

Come installo K8s Grafana Troubleshooting in TypingMind?

Apri Plugin → Skill → Installa da GitHub in TypingMind e incolla https://github.com/k8s-servant/k8s-skills/tree/main/skills/k8s-grafana-troubleshooting. TypingMind legge il file SKILL.md, include i file associati e installa la skill, che puoi abilitare per ogni singola chat.

Quali modelli IA possono usare K8s Grafana Troubleshooting?

Qualsiasi modello che colleghi a TypingMind. Le skill IA sono semplici istruzioni in Markdown anziché codice specifico di un fornitore, quindi GPT, Claude, Gemini, Grok e i modelli locali possono tutti caricare questa skill quando una richiesta corrisponde al suo scopo.

Quanti modelli IA posso usare con K8s Grafana Troubleshooting?

Quanti ne vuoi. Se un modello supporta le skill, puoi usarlo con K8s Grafana Troubleshooting: GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama e molti altri, tutti su TypingMind con le tue chiavi API.

La skill IA K8s Grafana Troubleshooting è gratuita?

Sì. È pubblicata su GitHub da k8s-servant con licenza Apache-2.0. Paghi solo il tuo fornitore IA per i token che usi.

Cosa sono le skill IA?

Una skill IA è un pacchetto di istruzioni riutilizzabili che insegna a un modello IA come svolgere un'attività specifica. Segue il formato aperto Agent Skills: un file SKILL.md con un nome e una descrizione, più eventuali script, template o file di riferimento di cui il modello potrebbe aver bisogno. Il modello legge le istruzioni solo quando la tua richiesta corrisponde alla skill, quindi una skill installata non comporta costi finché non viene usata.

In cosa si differenziano le skill IA dai plugin o dai server MCP?

Un plugin o un server MCP fornisce a un modello nuovi strumenti da richiamare: codice che viene eseguito da qualche parte e restituisce un risultato. Una skill IA, invece, fornisce al modello conoscenze e procedure: come affrontare un'attività, quali passaggi seguire e quali caratteristiche deve avere un buon output. Le skill sono semplici istruzioni in Markdown, quindi non richiedono server, chiavi API né ambienti di esecuzione e funzionano con qualsiasi modello.

Elenco completo

Crea subito il tuo spazio di lavoro AI

Iscriviti alla nostra newsletter per ricevere aggiornamenti sulle nuove funzionalità e sulle prossime iniziative a premi 👇