ArgoCD Integration

Integrate with ArgoCD to track deploys

Integrate ArgoCD deployments with OpsLevel's deploy integration to notify teams when and how often ArgoCD managed services are successfully released.

This integration leverages our OpsLevel CLI image to perform deploy event submissions. You can read more about how our CLI works on our GitHub repository and even download the CLI to test it out locally yourself.

After Getting Started With Deploy Webhooks, you will be ready to leverage an ArgoCD Resource Hook.

ArgoCD Resource Hook Setup

This Resource Hook illustrates a minimal example hook that will report a deploy to OpsLevel for each successful Sync. The import information is found in the containers: section of the manifest and assumes the OPSLEVEL_INTEGRATION_URL is stored in a secret. Note that my_service_alias is a placeholder for the alias of your service.

---
apiVersion: batch/v1  
kind: Job  
metadata:  
  generateName: app-opslevel-report-deploy
  annotations:  
    argocd.argoproj.io/hook: PostSync  
    argocd.argoproj.io/hook-delete-policy: HookSucceeded  
spec:  
  template:  
    spec:  
      containers:  
      - name: opslevel-report-deploy  
        image: public.ecr.aws/opslevel/cli:latest  
        command:
          - "opslevel"
          - "create"
          - "deploy"
          - "-s"
          - "my_service_alias"
        env:
          - name: OPSLEVEL_INTEGRATION_URL
            valueFrom:
              secretKeyRef:
                name: opslevel-secrets-example
                  key: integration-url-example
      restartPolicy: Never
  backoffLimit: 2

Options for 'opslevel create deploy'

Additional options can be passed into the command: array to specify commit, deploy, deployer, environment, and service information. To see an updated list of options install the cli then run opslevel create deploy --help