/k8s-skills:k8s-grafana-troubleshootingfrom k8s-skills
Investigates and fixes Grafana failures on Kubernetes: crash-loops, missing datasources/dashboards, 'No data' panels, 'Bad Gateway', 'database is locked', permission errors, login/sidecar 401, and grafana-operator sync issues. Uses kubectl logs, describe, events; never reads Secrets. Reads first and asks before changing.
Ships in k8s-skills. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
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.
401 Unauthorized.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:
k8s-prometheus-troubleshooting.k8s-network-troubleshooting.k8s-workload-troubleshooting,
k8s-storage-troubleshooting.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.
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).
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.
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.
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 see | Reference |
|---|---|
CrashLoopBackOff, Datasource provisioning error, failed to parse, a datasource or dashboard missing, sidecar not picking up ConfigMaps | references/provisioning.md |
"No data", Bad Gateway, connection refused, wrong datasource UID in a dashboard | references/datasources-no-data.md |
database is locked, permission errors, plugins, login and 401 Unauthorized, grafana-operator NoMatchingInstance | references/runtime-and-operator.md |
What the common findings mean (Grafana 13.2):
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./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.
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.
kubectl rollout restart deployment/my-grafana -n monitoring
# Undo: kubectl rollout undo deployment/my-grafana -n monitoring
Checked against the Grafana 13.2 documentation and source (v13.2.4), the Grafana Helm chart 14.0 and grafana-operator 5.25:
isDefault, providers.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
npx claudepluginhub k8s-servant/k8s-skills --plugin k8s-skills31 skills in this plugin
/k8s-aks-troubleshootingUse when a problem is specific to Azure Kubernetes Service (AKS): a cluster or node pool in "Failed" state, an upgrade or scale that fails ("UpgradeFailed", "violate the pod's disruption budget", "QuotaExceeded", "AllocationFailed"), a LoadBalancer Service stuck at <pending> ("SyncLoadBalancerFailed", "AuthorizationFailed"), an Azure Disk or Files PVC that fails ("ProvisioningFailed", "volume node affinity conflict", "Multi-Attach error", "Mount error(13)"), workload identity errors ("AADSTS700016", "AADSTS70021"), CoreDNS edits that AKS reverts, "error dialing backend", Azure Policy denials, or API server access (authorized IP ranges, private clusters, kubelogin, "User does not have access to the resource in Azure"). Investigates with kubectl and read-only az commands, and proposes fixes. Reads first and asks before changing anything./k8s-api-troubleshootingUse when the Kubernetes API server itself refuses or fails a request, before any controller acts on it: "failed calling webhook", "admission webhook ... denied the request", "ValidatingAdmissionPolicy ... denied request", a ReplicaSet with FailedCreate and no pods, an APIService "False (ServiceNotFound)", "FailedDiscoveryCheck" or "MissingEndpoints", "unable to retrieve the complete list of server APIs", a namespace stuck in Terminating, "no matches for kind" or "ensure CRDs are installed first", "strict decoding error: unknown field", a conversion webhook failure, "You must be logged in to the server (Unauthorized)", 429 "too many requests", "etcdserver:" errors, "Request entity too large" or "metadata.annotations: Too long". Investigates with kubectl get, describe, events and the health endpoints, and proposes fixes. Reads first and asks before changing anything./k8s-argocd-troubleshootingUse when Argo CD does not deploy or update an application in Kubernetes: an Application that is OutOfSync, Unknown, Degraded, Missing or Progressing, a ComparisonError ("app path does not exist", "unable to resolve ... to a commit SHA"), an InvalidSpecError ("do not match any of the allowed destinations in project"), a sync that fails ("one or more objects failed to apply"), auto-sync that never runs, resources that stay OutOfSync after a sync, or ApplicationSets that generate nothing. Investigates with kubectl get, describe, events and logs, and proposes fixes. Reads first and asks before changing anything./k8s-autoscaling-troubleshootingUse when Kubernetes autoscaling does not scale as expected: a HorizontalPodAutoscaler whose TARGETS show "<unknown>", "missing request for cpu", "unable to get metrics for resource cpu" or "FailedGetResourceMetric", an HPA stuck at maxReplicas ("TooManyReplicas") or not scaling down, "Metrics API not available" from kubectl top, metrics-server not Ready, a KEDA ScaledObject that is not Ready ("ScaledObjectCheckFailed") or creates no HPA, KEDA scalers failing, two autoscalers on one workload, or a VerticalPodAutoscaler without recommendations. Investigates with kubectl get, describe, events, logs and top, and proposes fixes. Reads first and asks before changing anything./k8s-cert-manager-troubleshootingUse when cert-manager does not issue or renew a certificate in Kubernetes: a Certificate that stays READY False, a CertificateRequest that is Pending, Denied or Failed, an Issuer or ClusterIssuer that is not Ready ("Error getting keypair for CA issuer"), "Referenced \"Issuer\" not found", ACME Orders or Challenges stuck pending (HTTP-01, DNS-01, rate limits), a certificate that expired or did not renew, or "failed calling webhook \"webhook.cert-manager.io\"" when applying resources. Investigates with kubectl get, describe, events and logs, and proposes fixes. Reads first and asks before changing anything./k8s-cilium-troubleshootingUse when networking fails on a Kubernetes cluster that runs Cilium as its CNI: traffic between pods dropped or timing out after a CiliumNetworkPolicy or CiliumClusterwideNetworkPolicy, "Policy denied" drops in Hubble, DNS that stops resolving after an egress policy, HTTP 403 "Access denied" from an L7 rule, toFQDNs rules that do not match, pods stuck ContainerCreating with "unable to connect to Cilium agent", Cilium agent or operator pods not ready, CiliumEndpoints not ready, or IPAM exhaustion. Investigates with kubectl get, describe, events and logs, asks before running cilium-dbg or hubble inside the agent, and proposes fixes. Reads first and asks before changing anything.2 plugins in one repository ship this exact skill · first indexed Oct 27, 2026
Other plugins' skills for the same job