Logo: K8s Grafana Troubleshooting

K8s Grafana Troubleshooting

Organisatioun
k8s-servant
k8s-grafana-troubleshooting

Sinn dës Skill, wann Grafana op Kubernetes Problemer mécht: de Grafana-Pod start ëmmer nees nei, nodeems d'Provisioning geännert gouf ("Datasource provisioning error", "Only one datasource per organization can be marked as default", "failed to parse"), en provisionnéierten Dashboard oder eng Datasource net erschéngt ("failed to load dashboard from", ConfigMap-Labels vum Sidecar), Panels "No data" weisen oder d'Datasource "Bad Gateway" oder "connection refused" zeréckgëtt, "database is locked" bei méi Replikater, Berechtegungsfeeler um Datevolume, "401 Unauthorized" beim Admin-Login oder beim Sidecar, oder grafana-operator-Ressourcen "NoMatchingInstance" weisen. Ënnersicht de Problem mat kubectl get, describe, events a Logs, ouni jee Grafana-Secrets ze liesen, a schléit Léisunge vir. Liest als éischt a freet, éier eppes geännert gëtt.

Iwwersiicht

Editeurk8s-servant
Repositoryk8s-skills
Skill-Nummk8s-grafana-troubleshooting
Stären
36
Forks
7
Matgeliwwert Dateien
3
LizenzApache-2.0
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 3 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    k8s-servant huet de Skill op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill K8s Grafana Troubleshooting an TypingMind, fir e mat all LLM ze benotzen, oder setzt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vu GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier, déi hei drënner steet, an a bestätegt d'Installatioun.
    https://github.com/k8s-servant/k8s-skills/tree/main/skills/k8s-grafana-troubleshooting
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill derbäisetzen → Iwwer eng GitHub-URL. Pecht dann d'URL vum Dossier an a klickt op Weider.
2

An engem anere KI-Agent installéieren

All KI-Agent, deen d'Format Agent Skills liest, kann dëse Skill benotzen — kopéiert den Dossier an d'Skill-Verzeechnes vun deem KI-Agent.

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
Start Claude Code nom Kopéieren nei, fir datt den neie Skill erkannt gëtt.

An TypingMind benotzen

Aktivéiert K8s Grafana Troubleshooting an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet K8s Grafana Troubleshooting automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass K8s Grafana Troubleshooting net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Schlësselen.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

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:

Matgeliwwert Dateien

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

Heefeg gestallte Froen

Wat mécht de KI-Skill K8s Grafana Troubleshooting?

Sinn dës Skill, wann Grafana op Kubernetes Problemer mécht: de Grafana-Pod start ëmmer nees nei, nodeems d'Provisioning geännert gouf ("Datasource provisioning error", "Only one datasource per organization can be marked as default", "failed to parse"), en provisionnéierten Dashboard oder eng Datasource net erschéngt ("failed to load dashboard from", ConfigMap-Labels vum Sidecar), Panels "No data" weisen oder d'Datasource "Bad Gateway" oder "connection refused" zeréckgëtt, "database is locked" bei méi Replikater, Berechtegungsfeeler um Datevolume, "401 Unauthorized" beim Admin-Login oder bei...

Firwat K8s Grafana Troubleshooting op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. K8s Grafana Troubleshooting besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt, amplaz en Abonnement pro Benotzerplaz ze bezuelen. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech K8s Grafana Troubleshooting an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/k8s-servant/k8s-skills/tree/main/skills/k8s-grafana-troubleshooting an. TypingMind liest d'Datei SKILL.md, bëndelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen K8s Grafana Troubleshooting benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat K8s Grafana Troubleshooting benotzen?

Esou vill wéi Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir K8s Grafana Troubleshooting domat benotzen – zum Beispill mat GPT, Claude, Gemini, Grok, DeepSeek, Mistral oder Llama – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill K8s Grafana Troubleshooting gratis?

Jo. k8s-servant huet de Skill ënner der Lizenz Apache-2.0 op GitHub publizéiert. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbare Pak vun Instruktiounen, deen engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt e maache soll a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a kee Lafzäitëmfeld a funktionéiere mat all Modell.

Alleguer weisen

Elo Ären eegene KI-Aarbechtsberäich ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇