Search
K

ArgoCD and Velocity

TL;DR: Watch theDemo Video

If ArgoCD is running in the same cluster as the service you're developing, no changes are required in order to use Velocity.
NOTE: certain advanced ArgoCD deployment strategies such as App of Apps and App of AppSets may require the solution described below.
However, if ArgoCD is running outside of your targeted development or staging cluster, you will need to make the following change to your ArgoCD application definition(s) in order to suspend the autosync functionality.
This will allow Velocity to temporarily replace an ArgoCD managed deployment during a Velocity development session.
NOTE: the minimum required version of ArgoCD for either of the following options is 2.1.0

Option 1: Update the CRD YAML manifest and apply with kubectl

apiVersion: argoproj.io/v1alpha1
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")'
...
kubectl apply -f argo-application.yaml

Option 2: Update the Argo Application via the ArgoCD UI

Click on the application tile in the Argo Workflows UI. Click the "App Details" button, and select "Manifest" on the top bar of the application details view.
Click "Edit," add the following to your application manifest, and then click "Save."
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")'
With one or the other of the above changes applied to your ArgoCD application definition, ArgoCD's autosync functionality remains active for any additional services deployed in your cluster, and it will be restored to the target service when your original deployment is restored after concluding your Velocity development session.

Demo Video