ArgoCD and Velocity

If ArgoCD is running outside of your targeted development or staging cluster, you will need to make some configuration adjustments to your ArgoCD application definitions

Certain advanced ArgoCD deployment strategies such as App of Apps and App of AppSets may require the solution described in this article.

If ArgoCD is running outside of your targeted development or staging cluster, you will need to make some configuration adjustments to your ArgoCD application definition(s) in order to suspend the autosync functionality and work with Velocity sessions.

This will allow Velocity to temporarily replace an ArgoCD-managed deployment in order to run a Velocity development session.

If ArgoCD is running in the same cluster as the service you're developing, no changes are required in order to use Velocity.

Prerequisites

The minimum required version of ArgoCD for either of the following options is 2.1.0

Configuration updates

You can choose for either of two configuration approaches:

See our demo video at the bottom of this article for more help.

Option 1: Update the CRD YAML manifest

For this option, you will update the CRD YAML manifest file and then apply the changes with kubectl.

  1. Adjust your manifest file to appear similar to the following example:apiVersion: argoproj.io/v1alpha1

CRD.yaml
kind: Application
...
spec:
  syncPolicy:
    syncOptions:
      ...
      # ### COPY ME ### Respect the ignore differences for applying as well:
      - "RespectIgnoreDifferences=true"
  ignoreDifferences:
    ...
    # ### COPY ME ### Ignore only during Velocity sessions:
    - group: "*"
      kind: "*"
      jqPathExpressions:
        - 'select(.metadata.labels["velocity.tech.v1/managed-by"] == "velocity-cli")'
... 
  1. Once you've updated the manifest file, apply the changes with kubectl:

kubectl apply -f argo-application.yaml

Following the application of these changes, the ArgoCD autosync functionality remains active for any additional services that are deployed in your cluster. The autosync is also reactivated for the target service when your original deployment is restored following the conclusion of your Velocity development session.

Option 2: Update the Argo Application

With this option, you will update the Argo application via the ArgoCD interface.

  1. Click on the application tile in the Argo Workflows interface.

  2. Click App Details.

  3. Select Manifest from the top bar of the application details view.

  4. Click Edit, add the following to your application manifest:

spec:
  syncPolicy:
    syncOptions:
      ...
      # ### COPY ME ### Respect the ignore differences for applying as well:
      - "RespectIgnoreDifferences=true"
  ignoreDifferences:
    ...
    # ### COPY ME ### Ignore only during Velocity sessions:
    - group: "*"
      kind: "*"
      jqPathExpressions:
        - 'select(.metadata.labels["velocity.tech.v1/managed-by"] == "velocity-cli")'
  1. Click Save. Following the application of these changes, the ArgoCD autosync functionality remains active for any additional services that are deployed in your cluster. The autosync is also reactivated for the target service when your original deployment is restored following the conclusion of your Velocity development session.

Demo video

Last updated