---
name: argocd-apps
description: >
  Read ArgoCD application status from GKE via kubectl (no ArgoCD CLI or SSO needed).
  Use when: checking whether ArgoCD apps for a region are healthy or synced;
  verifying app-delivery teardown completed; inspecting app status after a
  deploy or destroy workflow.
---

# ArgoCD App Status

Reads ArgoCD `Application` CRDs directly from GKE via kubectl. No ArgoCD CLI
or SSO login required — authenticates to GKE using gcloud.

**Prerequisite**: gcloud must be authenticated on the local machine
(`gcloud auth list` should show an active account).

## Environments

| Env | GKE Cluster | Region |
|---|---|---|
| `dev` | `dev-cicd-cluster-us-central1` | us-central1 |
| `staging` | `staging-cicd-cluster-us-central1` | us-central1 |
| `prod` | `cicd-cluster-us-central1` | us-central1 |

GCP project: `pingcap-dbaas-build`

## List ArgoCD apps

```python
result = await run_skill_script(skill_name="argocd-apps", script_path="scripts/list-argocd-apps.py", args={
    "env": "dev",
    "cluster": "<destination-cluster-name>",  # optional — omit to list all
    "output": "json",  # always use json when parsing the result
})
apps = json.loads(result)
```

Each entry in the returned array:

| Field | Description |
|---|---|
| `name` | ArgoCD app name |
| `destination` | `spec.destination.name` — the target k8s cluster |
| `sync_status` | `Synced` / `OutOfSync` / `Unknown` |
| `health_status` | `Healthy` / `Degraded` / `Progressing` / `Missing` / `Unknown` |

The `--cluster` filter matches `spec.destination.name` exactly. This is the
cluster name used by ArgoCD, not the GKE cluster name (e.g.
`dev-us-east-1-premium-1`, not `dev-cicd-cluster-us-central1`).

## Typical use

Check whether app-delivery teardown left any apps still present for a cluster:

```python
result = await run_skill_script(skill_name="argocd-apps", script_path="scripts/list-argocd-apps.py", args={
    "env": "dev",
    "cluster": "<region-cluster-name>",
    "output": "json",
})
apps = json.loads(result)
still_present = [a for a in apps if a["health_status"] != "Missing"]
```
