Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion skills/gitops/argo-cluster-debug/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,12 @@ instances and give one evidence-backed causal chain per independent finding.
does not establish its underlying cause. Continue independently observed faults even
when aggregate status appears healthy; do not invent repairs for intentional pauses
or other working-as-configured states.
- Prioritize recommendations and explain their impact, dependencies and reversibility.
- Rank applicable resolutions by the observed cause and prerequisites, then by impact
and reversibility. Put prerequisite repairs before retries; prefer the smallest
appropriate change to the authoritative input. Explain each option's impact,
dependencies and reversibility, why the first fits and when any alternative applies.
One recommendation or no change can be sufficient;
keep remedies for unverified causes conditional.
Establish affected workloads and shared consumers from ownership/references; label
inaccessible impact unverified. Operator input changes may restart components or
affect other Applications. Do not invent outage durations. Pruning can delete data;
Expand Down
22 changes: 19 additions & 3 deletions skills/gitops/argo-cluster-debug/references/debug-workflows.md
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,9 @@ Use when: user reports canary/blue-green rollout stuck, aborted, or degraded.
| Paused | Waiting for manual promotion or analysis |
| Progressing | Actively rolling out |
| Degraded | Rollout encountered errors |
| Aborting | Rollback in progress |
| Aborted | Rollback completed |

Abort is recorded in `.status.abort` and conditions, commonly with phase `Degraded`.
The abort flag alone does not establish restored availability or traffic routing.

3. For canary rollouts, check current step and step index:
```bash
Expand Down Expand Up @@ -335,7 +336,22 @@ Use when: user reports canary/blue-green rollout stuck, aborted, or degraded.
kubectl describe pods -n <namespace> -l rollouts-pod-template-hash=<canary-hash>
```

11. Produce a root cause analysis report.
11. Recommend the resolution matching the evidence:

| Observed cause/state | Resolution choice and recovery signal |
|---|---|
| Healthy, or an intentional approval pause | No repair. For requested advancement from a verified approval pause, propose normal promotion only when workload and analysis prerequisites permit; verify the resulting step or active Service. Promotion can advance analysis, so it is not a remedy for unresolved metrics. |
| Analysis running with observable progress | Continue observation within its configured policy. Elapsed time alone does not justify retry or abort. Verify new measurements and the expected step transition. |
| Analysis `Error` from provider connectivity, query or credentials | Correct the provider configuration/AnalysisTemplate or authoritative credential source. Recovery requires fresh valid measurements when analysis resumes. |
| Analysis `Inconclusive` | Preserve the pause while measurements are reviewed; correct a verified configuration error or obtain the intended promotion decision. Do not weaken thresholds just to proceed. |
| Valid failed metrics or a defective new revision | Correct the workload in Git; a compatible known-good revision is an alternative when restoration is preferred. If exposure must be stopped, consider abort as containment only after assessing stable capacity and the configured traffic strategy. Verify actual service availability and routing. |

For an aborted Rollout, propose retry only if the desired revision is still intended
and the underlying fault has been corrected. Retry clears the abort flag; it does not fix the cause.
Abort does not revert the desired pod template: a durable reversal belongs in Git.
Keep abort and retry as separate decisions under `../SKILL.md`'s write controls;
do not bypass analysis with `--full`. Reuse captured evidence for the recommendation,
and retain independent workload or traffic faults in the report.

---

Expand Down
14 changes: 10 additions & 4 deletions skills/gitops/argo-cluster-debug/references/health-degraded.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,15 @@ $KCTL get events -n <ns> --field-selector involvedObject.name=<pod> \
`--previous` often captures the crash before restart. Request it only when a previous
container exists; use bounded current logs when they contain the needed evidence.

Common causes and the evidence that confirms each:
Match the concrete error before choosing a correction; `ErrImagePull` or
`ImagePullBackOff` alone does not distinguish a bad reference from denied access.

| Cause | Confirmed by |
| Cause | Evidence and next step |
|---|---|
| Bad image or tag | `ErrImagePull` / `InvalidImageName`, event text naming the registry |
| Registry auth or rate limit | `ImagePullBackOff` with `401`, `403`, or `toomanyrequests` in the event |
| Bad image or tag | Invalid-reference or missing-manifest/tag error: correct the image in the owning manifest, Helm value or Kustomize override. A verified compatible previous image is an alternative when restoring service takes priority; do not guess a replacement tag. |
| Registry authentication / access | For a denied pull (`401`, `403`), correct the implicated Pod-template/ServiceAccount `imagePullSecrets` reference, credential source or registry permission. Correlate `FailedToRetrieveImagePullSecret` with the failed pull; that warning alone does not prove access is blocked. Rotate credentials through their actual secret manager only when needed; these are image-pull credentials, not Argo CD Git credentials. |
| Registry throttling | `429` or `toomanyrequests`: honor any reported retry interval; for recurring limits, have its owner assess authenticated access or an approved mirror. Repeated Pod restarts do not remove the limit. |
| Registry connectivity or TLS | DNS, connection or certificate error: repair the evidenced node-to-registry connectivity or trust configuration through its owner. Do not disable TLS verification or change the image merely to conceal an access fault. |
| Application crash on startup | `CrashLoopBackOff`, non-zero exit code, stack trace in `logs --previous` |
| OOM | `lastState.terminated.reason: OOMKilled`; compare to `resources.limits.memory` |
| Missing ConfigMap or Secret | `CreateContainerConfigError`, event naming the object. Note the object being missing does **not** itself make the app `Missing` |
Expand Down Expand Up @@ -138,3 +141,6 @@ can revert relevant live drift only when automation is enabled; `selfHeal: true`
`automated.enabled: false` does not establish reversion. Regardless of automation,
manifest defects such as a bad image, limit or environment value belong in Git.
Report the exact observed defect and durable correction; do not execute a live edit.
For image-pull recovery, verify the intended image/reference or managed credential
has reached the workload, then successful container startup and workload readiness.
Do not expose credential values or put plaintext credentials in Git.
17 changes: 11 additions & 6 deletions skills/gitops/argo-cluster-debug/references/health-progressing.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ $KCTL get ns <ns> -o jsonpath='phase={.status.phase}{"\n"}finalizers={.spec.fina
## 3. Pods that will not become ready

`Pending` pods without a qualifying container waiting error are `Progressing`;
inspect scheduling/storage constraints and FailedCreate quota events. A waiting
inspect scheduling/storage constraints and FailedCreate quota events. Quota rejection
can prevent Pod creation entirely; use the owning controller's event in that case. A waiting
error with restartPolicy Always can instead produce Degraded (`health-degraded.md`).

```bash
Expand All @@ -70,14 +71,18 @@ $KCTL get pods -n <ns> -l <selector> \
$KCTL get events -n <ns> --field-selector involvedObject.uid=<pod-or-replicaset-uid> --sort-by=.lastTimestamp | tail -25
```

| What you find | Cause |
| What you find | Cause and resolution choice |
|---|---|
| `PodScheduled=False`, reason `Unschedulable` | No node fits — resource requests, taints, node selector, affinity. The event message names which |
| Pending with an unbound PVC | Check the PVC; `WaitForFirstConsumer` deliberately waits for scheduling; inspect the actual scheduling/storage constraint before calling it a deadlock |
| Pending, `exceeded quota` event | ResourceQuota in the namespace |
| Running, `ready=false`, no restarts | Readiness probe failing or still in `initialDelaySeconds` |
| `PodScheduled=False`, reason `Unschedulable` | The event identifies requests, taints, selectors or affinity. Correct an unintended constraint in the owning manifest first; if requirements are valid, have the capacity owner provide suitable capacity. Do not reduce requests or broaden tolerations merely to fit; preserve workload needs and isolation. |
| Pending with an unbound PVC | `WaitForFirstConsumer` deliberately waits for scheduling. Correct an evidenced claim/consumer configuration error; otherwise have the storage owner repair provisioning or capacity. Preserve topology constraints; a Pending claim alone does not justify replacing storage. |
| `FailedCreate` with `exceeded quota` | Identify the exhausted quota key and requested amount. Correct unintended requests or replica counts in their owning configuration; if demand is valid, have the quota owner assess an increase and available capacity. Raising quota does not add node capacity. |
| Running, `ready=false`, no restarts | If startup is observably progressing, wait. Otherwise correct the evidenced application fault or erroneous probe path/port in Git; do not weaken a valid readiness check to mark the workload ready. |
| Running, `ready=false`, with restarts | Inspect previous logs using `health-degraded.md`; a Deployment can remain `Progressing` inside its deadline despite crashing child pods |

Verify recovery at the blocked stage: Pod creation after quota repair, `PodScheduled=True`
after placement repair, PVC binding and consumer startup after storage repair, then
workload readiness. Reuse the existing events and observations for the proposed checks.

For a Pod stuck initializing (`Init:...`), inspect `.status.initContainerStatuses`,
not only `.status.containerStatuses`. Read the failing init container's waiting or
termination reason and bounded logs (`-c <init-container>`); application-container
Expand Down
26 changes: 19 additions & 7 deletions skills/gitops/argo-cluster-debug/references/sync-failed.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ separate mechanisms.
| `exceeded quota` | A ResourceQuota in the destination namespace. | Read the quota directly |
| `namespaces "<ns>" not found` | Namespace creation was absent, failed or not completed before this task. | Section 7 |

For verified quota rejection, correct unintended requests/counts in the owning
manifest first. If demand is valid, have the quota owner assess the required allowance
and capacity; increasing quota supplies no node capacity. Verify the rejected creation
or update succeeds; a Pod may never have been created.

## 3. RBAC

Two independent layers, and both can reject a sync. Check both; fixing one while the
Expand Down Expand Up @@ -90,6 +95,8 @@ $KCTL get appproject "$PROJ" -n "$NS" -o jsonpath=''\

A project rejection reads differently — it names the project and happens before the API
call — so the message distinguishes the two layers for you.
Correct a workload that violates intended policy; only when access is intended should
the project owner amend the specific restriction. Avoid broad wildcard grants.

## 4. Invalid manifests

Expand All @@ -102,10 +109,10 @@ $KCTL get crd <plural>.<group> \

Causes worth separating, because they lead to different fixes:

- The manifest is genuinely malformed. A render-time templating bug produces this and
the repo is where it gets fixed.
- The CRD is an older version than the manifest expects. `unknown field` on a CR
usually means the operator providing the CRD has not been upgraded.
- The manifest is malformed: correct its source or rendering inputs in Git.
- The manifest requires a different CRD schema: prefer a compatible manifest when it
meets the intended behavior; otherwise propose an owner-managed supported upgrade.
An `unknown field` alone does not distinguish a typo from a version mismatch.
- A missing-kind dry run was skipped, so an error surfaced only at apply time.
Argo CD skips that dry run automatically when the CRD is in the same sync.
`SkipDryRunOnMissingResource=true` does not disable schema validation for a kind
Expand Down Expand Up @@ -146,6 +153,9 @@ A webhook that is *unreachable* rather than *denying* produces a different messa
`failed calling webhook ... connection refused` or `context deadline exceeded` — and is
an infrastructure fault, not a policy rejection. Its `failurePolicy: Fail` turns an
unreachable webhook into a blocked sync for every Application touching that kind.
For a valid denial, correct the manifest; an erroneous policy needs its owner's narrow
correction. For unavailability, restore the webhook dependency before retrying rather
than disabling admission to bypass it.

Correlate failures naming the same webhook across the relevant instance/destination.
Reuse captured errors; if necessary query compact conditions/results in its watched
Expand Down Expand Up @@ -203,9 +213,11 @@ Source: [Argo CD 3.4 auto-sync decision](https://github.com/argoproj/argo-cd/blo

## 9. Report

Name the failing resource when one is recorded, or the operation-level blocker. Quote
its message and classify the evidenced cause. State whether retries remain or whether
a terminal failure requires a changed desired input or separately authorized sync.
Name the failing resource when recorded, or the operation-level blocker, with its
message. Put the verified manifest, permission, hook or prerequisite repair before a
retry. After the repair, prefer a scheduled retry when available; a terminal failure
needs the recovery choice in section 8. Verification must show the previously blocked
stage succeeds and the operation progresses; preserve separate workload-health findings.

If the cause is RBAC on an operator-managed instance, do not produce a Role or
RoleBinding manifest. Hand off to `operator-rbac.md`.
26 changes: 15 additions & 11 deletions skills/gitops/argo-cluster-debug/references/sync-outofsync.md
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,10 @@ Evaluate application/namespace/cluster selectors, schedule, timezone and duratio
A matching active deny window can block sync; when matching allow windows exist,
being outside them can also block it. Manual-sync exceptions are separate; inspect
`manualSync` and effective window evaluation rather than inferring all manual behavior
from one window. Report intentional scheduling as working as configured.
from one window. For intentional scheduling, recommend waiting for the permitted
window. If the selector or schedule is wrong, propose the narrow correction in the
AppProject's owning configuration; an urgent manual sync is an alternative only when
policy permits it and separately authorized. Do not remove the window to clear status.

For evidence that an operator-managed instance is not watching this Application,
read `operator-apps-in-any-namespace.md`. The destination grant is a different layer.
Expand Down Expand Up @@ -128,11 +131,11 @@ revision, selective operation and pruning. Possible causes:

- **Admission mutation or another writer.** Correlate the actual field change with
webhook/controller evidence. A list of webhook names alone does not prove causation.
If another controller legitimately owns the field, consider narrowly scoped
Application `spec.ignoreDifferences`; instance-wide operator
`.spec.resourceIgnoreDifferences` has a wider impact. Confirm the installed schema.
Otherwise correct the conflicting desired input/controller configuration. Do not
hide an unexplained difference with a blanket ignore rule.
Prefer correcting the unintended writer's owning configuration. When external field
ownership is intentional, use narrowly scoped Application `spec.ignoreDifferences`;
consider operator `.spec.resourceIgnoreDifferences` only for an intentionally shared
rule, after confirming its schema and wider impact. Do not hide an unexplained
difference with a blanket ignore rule.
- **Server-side apply.** Argo CD 3.4 uses `--server-side --force-conflicts`. Another
entry in managedFields alone does not prove apply was rejected. Require the actual
operation error, or evidence of a subsequent rewrite. Read only relevant manager/path
Expand All @@ -142,7 +145,7 @@ revision, selective operation and pruning. Possible causes:
a field. That does not alone make the ignored field appear OutOfSync: identify any
unignored difference before claiming it explains Application status flapping.
- **Nondeterministic render.** Compare rendered output at the same inputs for generated
timestamps or random values. A `helm.sh/hook` annotation alone proves no randomness.
timestamps or random values. Fix the template or pin the intended value in its source.

Project `spec.ignoreDifferences` and `spec.syncPolicy.syncOptions` together only when
this branch needs them. See [3.4 sync options](https://argo-cd.readthedocs.io/en/release-3.4/user-guide/sync-options/).
Expand All @@ -161,7 +164,8 @@ Do not enable it or run a sync as diagnosis.

## 7. Report

State the evidenced cause, whether it is a fault, and what remains unverified. Manual
sync, closed windows and intentional retention can require no repair. A demonstrated
competing writer needs its owning configuration corrected; another sync alone will
not remove that cause. Keep independent health/operator findings in the final report.
State the evidenced cause and selected correction, or explain why manual sync, closed
windows or intentional retention require no repair. For a drift correction, verify the
relevant desired/live fields and that subsequent reconciliation no longer reverses them;
`Synced` alone cannot validate an ignored field. Another sync does not remove a competing
writer. Keep independent health/operator findings and unavailable checks in the report.
Loading