ArgoCD and Velocity
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
apiVersion: argoproj.io/v1alpha1
kind: Application
...
spec:
syncPolicy:
syncOptions:
...
# Respect the ignore differences for applying as well:
- "RespectIgnoreDifferences=true"
ignoreDifferences:
- group: "*"
kind: "*"
jqPathExpressions:
# Ignore only during Velocity sessions:
- 'select(.metadata.labels["velocity.tech.v1/managed-by"] ==
"velocity-cli")'
...
kubectl apply -f argo-application.yaml
Click on the application tile, 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:
...
# Respect the ignore differences for applying as well:
- "RespectIgnoreDifferences=true"
ignoreDifferences:
- group: "*"
kind: "*"
jqPathExpressions:
# Ignore only during Velocity sessions:
- '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.
Last modified 9d ago