[Live Webinar] Next-Level O11y: Why Every DevOps Team Needs a RUM Strategy Register today!

Back to All Docs

Argo CD Version Tags Argo CD Version Tags

Last Updated: Apr. 10, 2024

Coralogix provides seamless integration with Argo CD so you can push tags to Coralogix automatically from your Argo CD pipelines.

Prerequisites

Coralogix Alerts API key

Configuration

Add Coralogix API Token to argocd-notifications-secret Secret:

apiVersion: v1
kind: Secret
metadata:
  name: argocd-notifications-secret
type: Opaque
stringData:
  coralogix-api-token: <YOUR-API-TOKEN>

Add webhooktemplate and trigger to argocd-notifications-cm ConfigMap. Select the Version Tags endpoint corresponding with your Coralogix domain for the url.

DomainVersion Tags endpoint
.comhttps://webapi.coralogix.com/api/v1/external/tags/
.ushttps://webapi.coralogix.us/api/v1/external/tags/
.inhttps://webapi.app.coralogix.in/api/v1/external/tags/
.app.coralogixsg.comhttps://webapi.coralogixsg.com/api/v1/external/tags/
eu2.coralogix.comhttps://webapi.eu2.coralogix.com/api/v1/external/tags/
cx498.coralogix.comhttps://webapi.cx498.coralogix.com/api/v1/external/tags/
apiVersion: v1
kind: ConfigMap
metadata:
  name: argocd-notifications-cm
data:
  service.webhook.coralogix: |
    url: <version-tags-endpoint>
    headers:
    - name: Authorization
      value: Bearer $coralogix-api-token
    - name: Content-Type
      value: application/json
  template.coralogix: |
    webhook:
      coralogix:
        method: POST
        body: |
          {
            "name": "{{.app.status.sync.revision}}",
            "application": ["{{.app.spec.project}}"],
            "subsystem": ["{{.app.metadata.name}}"],
            "iconUrl": "https://raw.githubusercontent.com/coralogix/integrations-docs/master/integrations/argocd/images/argocd.png"
          }
  trigger.coralogix-on-success: |
    - when: app.status.operationState.phase in ['Succeeded']
      send: [coralogix]

There are 2 ways to publish a patch with the added annotation, the first by creating a yml and preforming the patch by specifing the patch file. Or by using a command with the patch written into it.

  • The yml file:
apiVersion: argoproj.io/v1alpha1
kind: Application
metadata:
  name: <deployed-app-name>
  annotations:
    notifications.argoproj.io/subscribe.coralogix-on-success.coralogix: ""
  • The command:
kubectl patch app <deployed-app-name> -n argocd -p '{"metadata": {"annotations": {"notifications.argoproj.io/subscribe.coralogix-on-success.coralogix": ""}}}' --type merge

To check if the patch was successfully been created, in Argocd enter the deployed app in which the notifications were added under the annotations field you will find the Coralogix notification.
Each time the application syncs in Argocd it’ll automaticly send a tag to Coralogix dashboard.

On this page

Live Webinar
Next-Level O11y: Why Every DevOps Team Needs a RUM Strategy
April 30th at 12pm ET | 6pm CET
Save my Seat