You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be great to have an option to trigger sync by patching existing CRD (kind: Application).
Motivation
I have application which should be synced only by after external request (preferably, from Argo WorkFlow).
ArgoWF can patch existing manifests, this is example of already working patch:
So if this feature would be implemented, I'd just add into k8s-manifest above few lines to trigger sync. Now I have workaround with Argo Workflow, where I trigger sync with argocd-cli, this example (source) is similar to my workaround:
apiVersion: argoproj.io/v1alpha1
kind: WorkflowTemplate
metadata:
name: argocd-sync-and-wait
annotations:
workflows.argoproj.io/description: >-
This task syncs (deploys) an Argo CD application and waits for it to be healthy.
To do so, it requires the address of the Argo CD server and some form of
authentication either a username/password or an authentication token.
workflows.argoproj.io/maintainer: '@dcherman'
workflows.argoproj.io/tags: argocd
workflows.argoproj.io/version: '>= 2.9.0'
spec:
entrypoint: argocd-sync-and-wait
templates:
- name: argocd-sync-and-wait
inputs:
parameters:
- name: argocd-version
value: v1.6.0
- name: application-name
- name: revision
value: HEAD
- name: flags
value: --
- name: argocd-server-address
- name: argocd-credentials-secret
script:
image: argoproj/argocd:{{inputs.parameters.argocd-version}}
command: [bash]
env:
- name: ARGOCD_AUTH_TOKEN
valueFrom:
secretKeyRef:
name: "{{inputs.parameters.argocd-credentials-secret}}"
key: token
optional: true
- name: ARGOCD_USERNAME
valueFrom:
secretKeyRef:
name: "{{inputs.parameters.argocd-credentials-secret}}"
key: username
optional: true
- name: ARGOCD_PASSWORD
valueFrom:
secretKeyRef:
name: "{{inputs.parameters.argocd-credentials-secret}}"
key: password
optional: true
- name: ARGOCD_SERVER
value: "{{inputs.parameters.argocd-server-address}}"
source: |
#!/bin/bash
set -euo pipefail
if [[ -z $ARGOCD_AUTH_TOKEN ]] && [[ -z "$ARGOCD_USERNAME" || -z "$ARGOCD_PASSWORD" ]]; then
echo "Either the ARGOCD_AUTH_TOKEN must be specified, or the ARGOCD_USERNAME/ARGOCD_PASSWORD must be specified."
exit 1
fi
if [ -z $ARGOCD_AUTH_TOKEN ]; then
yes | argocd login "$ARGOCD_SERVER" --username=$ARGOCD_USERNAME --password=$ARGOCD_PASSWORD {{inputs.parameters.flags}}
fi
echo "Running as ArgoCD User:"
argocd account get-user-info {{inputs.parameters.flags}}
argocd app sync {{inputs.parameters.application-name}} --revision {{inputs.parameters.revision}} {{inputs.parameters.flags}}
argocd app wait {{inputs.parameters.application-name}} --health {{inputs.parameters.flags}}
But I think, that patching CRD is better in this case. May be this is already supported, if yes, please, help me to find out how to do it.
Thank you in advance. And thank you very much for such amazing project!
The text was updated successfully, but these errors were encountered:
Argo CD should start synchronization once the field is set and will remove it when the sync is completed. Using Argo Workflows you might simulate "argocd app wait" using resource step and successCondition/failureConditiondocs:
Summary
It would be great to have an option to trigger sync by patching existing CRD (kind: Application).
Motivation
I have application which should be synced only by after external request (preferably, from Argo WorkFlow).
ArgoWF can patch existing manifests, this is example of already working patch:
So if this feature would be implemented, I'd just add into k8s-manifest above few lines to trigger sync. Now I have workaround with Argo Workflow, where I trigger sync with argocd-cli, this example (source) is similar to my workaround:
But I think, that patching CRD is better in this case. May be this is already supported, if yes, please, help me to find out how to do it.
Thank you in advance. And thank you very much for such amazing project!
The text was updated successfully, but these errors were encountered: