Skip to main content

Overview

OpenSRE queries the Argo CD REST API as a read-only evidence source when you ask about GitOps deployments. It can list visible applications, inspect one application’s sync and health status, and fetch sanitized server-side diff output to show deployment drift.

Prerequisites

  • Argo CD API server reachable from the machine running OpenSRE
  • A dedicated Argo CD account or API token with read access to the applications you want OpenSRE to inspect
  • The Argo CD base URL, for example https://argocd.example.com

Setup

Argo CD is configured through environment variables or the persistent integration store. There is no dedicated opensre integrations setup argocd wizard today.

Option 1: Environment variables

Add one authentication method to your .env:
OpenSRE rejects ambiguous auth configuration. Do not set a bearer token and username/password at the same time.

Option 2: Persistent store

You can also add Argo CD to ~/.opensre/integrations.json:
The store also accepts auth_token or token as aliases for bearer_token. For username/password auth, omit bearer_token and set username and password instead.

Option 3: Multiple Argo CD instances

For multiple Argo CD instances, set ARGOCD_INSTANCES to a JSON array. The first valid instance is used as the default integration.
When ARGOCD_INSTANCES is set, the single-instance ARGOCD_BASE_URL and auth variables are ignored for this service. opensre integrations verify argocd validates the resolved default instance.

Credentials

  1. In Argo CD, create a dedicated read-only account or API token for OpenSRE.
  2. Grant that identity list/get access to the applications (and projects) you want investigated.
  3. Set either:
    • ARGOCD_AUTH_TOKEN / ARGOCD_TOKEN (or store bearer_token), or
    • ARGOCD_USERNAME + ARGOCD_PASSWORD (or store username / password)
  4. Set ARGOCD_BASE_URL to your API base (HTTPS for remote hosts).

Tools

Once Argo CD is configured, start opensre and name the application in your question, e.g. “Is checkout-api out of sync? What drifted?”

Local verification recipe

Verified both registered tools live against a real local Argo CD install with a real GitOps application synced from a public repo.
The stock install.yaml fails under a plain kubectl apply with metadata.annotations: Too long: may not be more than 262144 bytes — the ApplicationSet CRD is large enough that client-side apply’s kubectl.kubernetes.io/last-applied-configuration annotation exceeds Kubernetes’ own annotation size limit. --server-side --force-conflicts avoids storing that annotation entirely.
Create a real Application synced from Argo CD’s own public example repo:
Verify:
Chat sessions (unlike opensre integrations verify) only fall through to env vars when the store has no records at all — any existing record, for any service, blocks env-var resolution entirely. Point OPENSRE_INTEGRATIONS_STORE_PATH at a path inside a fresh empty directory instead, so your real config is never read or written and the ARGOCD_* vars above are the only source of connection info:
argocd_application_diff needs real drift to return anything interesting — with selfHeal: true set above, Argo CD reverts live-cluster drift within seconds, so disable automated sync first to introduce a drift that actually sticks:
Now ask the agent about the drift:
Ask: Is the guestbook Argo CD application out of sync? What drifted? The agent decides which tools to call on a given turn, so argocd_application_diff isn’t guaranteed to run every time — on a turn where it did, it correctly reported the drift introduced above: guestbook-ui’s replica count changed from the desired 1 to the live 3. Both registered tools return real data through this same chat flow — argocd_application_status for sync/health status, revision, and operation phase, and argocd_application_diff for per-resource drift when the agent calls it. Teardown:

Verify

Expected output:
Verification performs a read-only application list call. It proves OpenSRE can reach Argo CD and list visible applications with the configured credentials; it does not write to Argo CD or sync applications.

Troubleshooting

Security

  • Use a dedicated read-only Argo CD account or token for OpenSRE.
  • Store credentials in .env or ~/.opensre/integrations.json, not in source code.
  • Use https:// for remote Argo CD URLs. Plain http:// is accepted only for loopback or localhost development URLs.
  • Do not disable ARGOCD_VERIFY_SSL for production instances.
  • OpenSRE redacts bearer tokens, passwords, token-like strings, and Kubernetes Secret diffs before surfacing Argo CD errors or diff evidence.
  • The integration is read-only: it lists applications, reads application summaries, and reads server-side diff data. It does not sync, modify, or delete Argo CD resources.