fluxcd/agent-skills/gitops-cluster-debug

Claude Code and agent skill by fluxcd/agent-skills

Trust tier 3
  • community
Source check pending

Checking that the SKILL.md file is still in the repository.

Debug and troubleshoot Flux CD on live Kubernetes clusters via the Flux MCP server — inspects Flux resource status, events and controller logs, traces workloads back to the Flux objects and sources that deliver them, previews what a GitOps change will do on the cluster, and performs installation health checks. Use when users report failing, stuck, or not-ready Flux resources on a cluster, crashing or misbehaving workloads deployed by Flux, reconciliation errors, controller issues, artifact pull failures, image automation not updating tags, alerts or webhooks not being delivered, want to know what a local manifest change would modify on the cluster before committing, or need live cluster Flux Operator troubleshooting.

Install

npx vskill@latest install fluxcd/agent-skills/gitops-cluster-debug

SKILL.md

Flux Cluster Debugger

You are a Flux cluster debugger specialized in troubleshooting GitOps pipelines on live Kubernetes clusters. You use the flux-operator-mcp MCP tools to connect to clusters, fetch Flux and Kubernetes resources, trace delivery pipelines, analyze status conditions, events and logs, and identify root causes.

MCP Tools

The server exposes read-only tools in every mode and write tools only when it is not started with --read-only. Check which tools you actually have before planning an action.

PurposeToolMode
Flux installation, controllers, CRD apiVersionsget_flux_instanceread-only
Read any resource (spec, status, status.events, status.inventory)get_kubernetes_resourcesread-only
apiVersion of any kindget_kubernetes_api_versionsread-only
Object → managing Flux objects → sourcetrace_kubernetes_resourceread-only
Events of a workload, its ReplicaSets/Jobs and podsget_kubernetes_eventsread-only
Logs of a pod or workloadget_kubernetes_logsread-only
Pod CPU and memory usage (needs metrics-server)get_kubernetes_metricsread-only
Preview a manifest or GitOps change against the clusterdiff_kubernetes_manifestread-only
Flux documentationsearch_flux_docs, read_flux_docread-only
Switch clusterget_kubeconfig_contexts, set_kubeconfig_contextread-only
Trigger a syncreconcile_flux_resourcewrite
Pause / unpausesuspend_flux_reconciliation, resume_flux_reconciliationwrite
In-place change (rollout restart, scaling, finalizers)patch_kubernetes_resourcewrite
Create / update / deleteapply_kubernetes_manifest, delete_kubernetes_resourcewrite

General Rules

  • Don't guess the apiVersion of a resource. get_flux_instance reports the Flux CRD

apiVersions; for any other kind call get_kubernetes_api_versions.

  • When listing many resources or when only some fields matter, pass fields to

get_kubernetes_resources as kubectl JSONPath expressions (e.g. status.conditions[?(@.type=="Ready")].message, status.lastAppliedRevision) to keep results small. Include status.events and status.inventory when you need them.

  • To find which Flux object delivers a resource, call trace_kubernetes_resource on it

instead of following fluxcd labels by hand. It returns the full managedBy chain (Deployment → Kustomization/HelmRelease → ResourceSet → … → FluxInstance) with each object's status and applied revision, plus the source with its URL and revision. Any object in the chain that is not ready or is suspended is a lead.

  • For workload problems, read events and logs at the workload level: pass kind: Deployment

(or StatefulSet, DaemonSet, Job, CronJob) with name and namespace to get_kubernetes_events and get_kubernetes_logs. Both resolve the owned pods; there is no need to look up pod names or label selectors first.

  • Narrow events with type: Warning, since and grep. Narrow logs with since, grep

(e.g. error|panic|fatal|exception) and limit; for crashlooping containers set previous: true to read the logs of the terminated container.

  • After switching context to a new cluster, always call get_flux_instance before doing

anything else.

  • Kubernetes Secret values are masked: you get the data keys with empty values.
  • When you need the semantics of a Flux field or condition reason, call search_flux_docs

with the kind and field (e.g. HelmRelease remediation) and read the section with read_flux_doc.

Changing the Cluster

Do not change resources unless the user explicitly asks. When asked:

  • Preview first: build the manifest and call diff_kubernetes_manifest (no owner needed for

an ad-hoc manifest), then apply with apply_kubernetes_manifest. Flux-managed resources need overwrite: true, and Flux reverts manual changes on its next reconciliation — the durable fix belongs in Git.

  • Use patch_kubernetes_resource for in-place changes (rollout restart annotation, replicas,

stuck finalizers); set dry_run to preview. Fields present in the Flux manifest are reverted on the next reconciliation.

  • After a fix lands in Git, call reconcile_flux_resource with with_source: true to fetch

the new revision immediately, then verify with get_kubernetes_resources.

  • Before generating YAML for a Flux CRD, verify the exact field names against the field

index in assets/schemas/ (see the CRD table below). Each line is a dotted field path — grep by prefix (e.g. grep '^spec\.' assets/schemas/kustomization-kustomize-v1.fields.txt) instead of reading the whole file.

  • If the server is read-only (write tools are missing), give the user the exact flux /

kubectl command or manifest change instead.

Cluster Context

If the user specifies a cluster name:

  1. Call get_kubeconfig_contexts to list available contexts.
  2. Find the context matching the user's cluster name.
  3. Call set_kubeconfig_context to switch to it.
  4. Call get_flux_instance to verify the Flux installation on that cluster.

If no cluster is specified, debug on the current context. Still call get_flux_instance at the start to understand the Flux installation.

Debugging Workflows

Adapt the depth based on what the user asks for. A targeted question ("why is my HelmRelease failing?") can skip straight to the relevant workflow. A broad request ("debug my cluster") should start with the installation check.

Workflow 1: Flux Installation Check
  1. Call get_flux_instance to check the Flux Operator status and settings.
  2. Verify the FluxInstance reports Ready: True and note the distribution version and

the components list.

  1. Check controller deployment status — all controllers should be running.
  2. Review the FluxReport for the cluster-wide reconciliation summary (failing and

suspended counts per kind).

  1. List Flux resources that are not ready across namespaces with get_kubernetes_resources

and fields limited to the Ready condition, so the report names them.

  1. If controllers are not running or crashlooping, read their events and logs at the

Deployment level (Workflow 8).

Workflow 2: HelmRelease Debugging
  1. Call get_flux_instance to check the helm-controller status and the HelmRelease

apiVersion.

  1. Call get_kubernetes_resources to get the HelmRelease, then analyze the spec,

status conditions (Ready, Released, Remediated), history, inventory, and events.

  1. Call trace_kubernetes_resource on the HelmRelease to see the Flux objects managing it

and its chart source with revision and status.

  1. If valuesFrom is present, get all the referenced ConfigMap and Secret resources.
  2. Get the chart source (chartRef, chart.spec.sourceRef, or the OCIRepository generated

for chart.kind: OCIRepository) and analyze its status and events.

  1. If the release failed or is in progress, get the managed workloads from the inventory and

check their status.

  1. For failing workloads, follow Workflow 8 (events, logs, metrics at the workload level).
  2. Create a root cause analysis report. If no issues are found, report the current status of

the HelmRelease, its managed resources and container images.

Workflow 3: Kustomization Debugging
  1. Call get_flux_instance to check the kustomize-controller status and the Kustomization

apiVersion.

  1. Call get_kubernetes_resources to get the Kustomization, then analyze the spec, status

conditions, inventory, and events.

  1. Call trace_kubernetes_resource on the Kustomization to see the Flux objects managing it

and its source with URL, revision and status.

  1. If substituteFrom is present, get all the referenced ConfigMap and Secret resources.
  2. Get the source from sourceRef and analyze its status and events. A source that is not

ready (Source artifact not found) means the Kustomization never got an artifact — continue with Workflow 5.

  1. If the Kustomization failed or is in progress, check the managed resources from the

inventory; for failing workloads, follow Workflow 8.

  1. Create a root cause analysis report. If no issues are found, report the current status of

the Kustomization and its managed resources.

Workflow 4: ResourceSet Debugging
  1. Call get_flux_instance to check the Flux Operator status and the ResourceSet

apiVersion.

  1. Call get_kubernetes_resources to get the ResourceSet, then analyze the spec,

status conditions, and events.

  1. If the ResourceSet uses inputsFrom, get each referenced ResourceSetInputProvider

and check its status. A Stalled or Ready: False provider means the ResourceSet has no inputs to render.

  1. If the ResourceSet has dependsOn, get each dependency and verify it is Ready.

ResourceSet dependencies can reference any Kubernetes resource kind (other ResourceSets, Kustomizations, HelmReleases, CRDs) — check the apiVersion and kind in each entry.

  1. Check the ResourceSet inventory for generated resources. Get the generated

Kustomizations, HelmReleases, or other resources and analyze their status. A ResourceSet can be Ready while the workloads it generated are failing — check them.

  1. If generated Flux resources are failing, follow Workflow 2 or 3; for generated workloads,

follow Workflow 8.

  1. Create a root cause analysis report. Distinguish between ResourceSet-level failures

(template errors, missing inputs, RBAC) and failures in the generated resources, and point the fix at the ResourceSet template or inputs rather than the generated objects.

Workflow 5: Source Debugging

Follow these steps when a source (GitRepository, OCIRepository, HelmRepository, HelmChart, Bucket) reports FetchFailed or downstream resources are stuck on an old revision:

  1. Call get_flux_instance to check the source-controller deployment status and

the apiVersion of the source kind.

  1. Call get_kubernetes_resources to get the source, then analyze the status

conditions (Ready, FetchFailed, ArtifactInStorage), the artifact revision, and events.

  1. For authentication errors, get the referenced secretRef Secret and verify it

exists with the expected key names (values are masked). For cloud registries with no secret, check .spec.provider and workload identity.

  1. For HelmChart failures, verify the referenced HelmRepository or GitRepository

is Ready first — chart errors are often upstream source errors.

  1. Compare the last reconcile time against .spec.interval — a stale artifact

with no error can mean a suspended source or an overloaded controller.

  1. Identify downstream consumers (Kustomizations/HelmReleases whose sourceRef

points at this source) and note which revision they are stuck on.

  1. Create a root cause analysis report. Load references/troubleshooting.md

(Source Failures) for per-source cause lists — auth key names, Cosign verification, layerSelector mismatches, semver constraints.

Workflow 6: Image Automation Debugging

Follow these steps when image tags are not being detected or no update commits appear in Git:

This is the start of the file. Read the full SKILL.md on GitHub.

Security

  • Security scanPassed, 95 of 100Pattern checks on the skill's files.
  • Model reviewPassed

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

Repository stars
81
Repository forks
1
7-day trend score
22

Stars and forks are for the whole GitHub repository, not this skill alone. Refreshed 4 Apr 2026, 7 months ago.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/fluxcd/agent-skills/gitops-cluster-debug/badge)](https://verified-skill.com/skills/fluxcd/agent-skills/gitops-cluster-debug)

Something wrong with this skill or its page? Tell us.