Integrate Spike with Argo CD
Send Argo CD notifications to Spike so a failed sync or unhealthy app alerts your on-call team, and the incident resolves when the app is healthy again.
Argo CD is a declarative GitOps continuous delivery tool for Kubernetes. It keeps each Application in your cluster matched to the Git revision it points at, and reports when a sync fails or the application stops being healthy.
Argo CD Notifications can post to any webhook. Point one at a Spike integration URL and a failed sync or a degraded application pages your on-call rotation, repeats join the incident already open, and the incident resolves itself when Argo CD reports the application healthy and synced.
Nothing is installed in your cluster. The setup is one webhook service, two templates and two triggers in the argocd-notifications-cm ConfigMap, plus a subscription on the applications you want to watch.
How Spike reads a notification
Spike reads the status field you type into each template and the Application's UID.
status
What Spike does
firing
Opens an incident, or joins the open one for the same app_uid
resolved
Resolves the open incident with the same app_uid. With nothing open, the recovery is dropped
Anything else, or missing
Treated as firing. Spike never resolves on it
operation_phase, health_status and sync_status only choose the wording of the title. They never open or close anything.
Incident identity
Spike identifies the incident by app_uid, the Application's Kubernetes UID. It is stable for the Application's whole life, so repeats join the incident already open and the recovery resolves it. The title is for reading only.
app_uid counts only when it is a non-empty string (or a number) and not an unexpanded template: <no value>, anything containing {{ or }}, or a whole value like $app_uid, ${app_uid} or %app_uid%. Without a usable app_uid, Spike matches the open incident by title instead of by app_uid, so repeats of the same alert for the same application still join one incident. The title is then the plain one with no Argo CD sentence in it: a failed sync reads Sync failed on {app} on every retry, however operation_message changes.
Incident title
operation_phase Failed or Error, with operation_message and a usable app_uid
{operation_message} on {app}
operation_phase Failed or Error, any other case
Sync failed on {app}
health_status Degraded, Missing or Unknown
Health {health_status} on {app}
sync_status Unknown
Sync status Unknown on {app}
Anything else
Argo CD alert on {app}
status resolved
{app} is synced and healthy
With no usable app, on {app} is left off (Sync failed, Argo CD application is synced and healthy), and with nothing usable the title is Argo CD alert with no details. Whitespace in the sentence is collapsed, and on {app} is left off when the sentence already names the application as a whole word. Titles are capped at 200 characters: on {app} is kept whole and the sentence is cut at a word boundary with .... Revisions, URLs and timestamps are never in the title.
Argo CD may change operation_message between deliveries (for example by appending (retried 2 times)). That is fine: the app_uid is what joins them.
Severity
Spike does not read a severity from the Argo CD payload, so incidents open at your integration's default. Use an alert rule on health_status, project or app to set severity, route to another service or suppress. Read more about priority and severity.
Prerequisites
Argo CD with the Notifications controller running (bundled with Argo CD 2.3 and later)
Permission to edit the
argocd-notifications-cmConfigMap and to annotate Applications or AppProjectsAn Argo CD integration in Spike and its webhook URL
Nothing to open on your network. Argo CD calls out to Spike, so your cluster needs outbound HTTPS to
hooks.spike.sh
Step 1 — Create the integration in Spike
In Spike, go to Integrations → Add integration → Argo CD, attach it to a service and an escalation policy, and copy the webhook URL. It looks like https://hooks.spike.sh/<your-token>/push-events.
Step 2 — Store the webhook URL in Argo CD
The URL contains your token, so keep it in the argocd-notifications-secret Secret rather than in the ConfigMap:
If you manage the Secret declaratively, add a spike-url key to it instead.
Step 3 — Add the service, templates and triggers
Argo CD has no screen for notifications; they are configured in the argocd-notifications-cm ConfigMap. Edit it (kubectl -n argocd edit configmap argocd-notifications-cm) and add the following. Argo CD has no variable that says which trigger fired, so the status value is typed into each template as a literal. {{.context.argocdUrl}} needs the context entry shown.
Send the body exactly as shown, field for field. This is what a failed sync looks like once rendered:
And the recovery, once the application is healthy and synced again:
status
Required. firing or resolved, typed as a literal in each template
app_uid
Required for joining and resolving. The incident's identity; see Incident identity
app
Required. The application name at the end of every title
operation_message
The sentence in a sync failure title, when operation_phase is Failed or Error and app_uid is usable
operation_phase
Failed or Error selects the sync failed title
health_status
Degraded, Missing or Unknown selects the health title
sync_status
Unknown selects the sync status title
app_namespace, project, revision, destination_server, destination_namespace, finished_at, app_url
Incident details only
Step 4 — Subscribe your applications
Subscriptions are annotations. Add them to a single Application, or to an AppProject to cover every Application in it:
The part after subscribe. is the trigger name and the last part, spike, is the webhook service from Step 3. The value stays empty because a webhook service has no recipient.
Step 5 — Confirm it end to end
Send a test notification from the CLI:
Check the incident that opens in Spike. Its page shows the application name, UID, phase and health status.
Break a sync on purpose (for example a manifest with a missing required field) and look for an incident titled with the sync error and your application name.
Fix the manifest, sync again, and watch the incident resolve; its last event is titled
<app> is synced and healthy.
Things worth knowing
One service covers every application. Add the webhook service once; subscribe as many Applications or projects as you like.
Each fault has its own trigger. A trigger without
oncePersends once each time its condition goes from false to true. Keeping sync failure, health and sync status in separate triggers means a new fault still sends while another is active, for example a failed sync on an application that is alreadyDegraded.on-spike-sync-failedusesoncePeron the operation'sfinishedAt, so each failed operation notifies once.Resolving in Spike does not touch Argo CD. The Application keeps its status; the next failure opens a fresh incident.
Troubleshooting
Disclaimer: These integration instructions are offered independently by Spike.sh, and Spike.sh is not affiliated with nor a partner of the Argo Project or the Linux Foundation.
Last updated

