Home > docs > plugins v2 > Argo CD Task
The argocd
task allows workflows to interact with various
Argo CD API endpoints to manage applications
and projects on the instance.
To enable the task in a Concord flow, it must be added as a dependency:
This adds the task to the classpath and allows you to invoke the task in a flow:
Common Parameters
action
: Action to perform. One of:
get
- Get the detailed information about the specified app
.create
- Creates an application on the specified Argo CD baseUrl
.sync
- Sync an existing application to its desired state.patch
- patch the source information in an application on the Argo CD instance.setParams
- Set an application’s parameters.updateSpec
- Update the application manifest with the spec
provided.delete
- Delete an application on the specified Argo CD baseUrl
.getProject
- Get the details information about the specified project
.createProject
- Creates a project on the specified Argo CD baseUrl
.deleteProject
- Delete a project on the specified Argo CD baseUrl
.baseUrl
: Argo CD instance’s base URLdebug
: optional boolean
, enabled extra debug log output for troubleshootingauth
: API authentication info. Used to generate an authentication token.validateCerts
: optional boolean
, default value true
, can be overridden for testing.connectTimeout
: optional value specifies the connection timeout while making API requests to Argo CDreadTimeout
: optional value specifies the read timeout while making API requests to Argo CDwriteTimeout
: optional value specifies the write timeout while making API requests to Argo CD.In addition to
common task result fields,
the output of the full argocd
task call returns the following depending
on the action performed.
application
- manifest of the application on which action
was performed.The output of public method calls may be different depending on the method called. See the documentation for the specific method for output details.
Authentication with Argo CD can happen in two ways depending on the auth configuration on the Argo CD instance.
This type of authentication is used when there are local users setup on the Argo CD instance for administrative purposes, for example.
In this case, Argo CD instance delegates authentication to an LDAP directory backed authentication mechanism.
In this case, Argo CD instance authentication is done via Azure AD. Azure AD App registration and configuration must be in place to work. More details can be found here.
clientId
- ClientId of the argocd client app registered in Azure portal.authority
- Identity of the party who issue token. For example - https://login.microsoftonline.com/<tenantId>/v2.0
scope
- Optional, Permissions needed to perform activity. Default - user.read
username
- Username used to authenticate in Azure ADpassword
- Password for the supplied username
Note: Allow public client flows should be enabled in Authentication > Advanced settings under Azure App registration.
Use the get
action to get the details of an application
present on the Argo CD instance.
Parameters
app
: Name of the application to be retrieved.refresh
: optional boolean
forces application reconciliation if set to true
Use the create
action to create an application with
the provided details
Parameters
app
: Name of the application to be created.cluster
: Name of the Kubernetes cluster on which the application is to be created.namespace
: Namespace in which the application is to be created.createNamespace
: optional boolean
when set will force creation of the namespace
specified, if not present.gitRepo
: optional SCM information to which the application will sync. Not required
if helmRepo
is specified.
repoURL
: URL of the SCM RepositorytargetRevision
: Branchname, tag, or commit hash to sync to.path
: The path in the SCM repository which contains Helm charts, application
manifest, or k8s resource definitions.helmRepo
: optional Helm repo information to which the application will sync. Not
required if gitRepo
is specified.
repoURL
: URL of the Helm Repositorychart
: Name of the Helm CharttargetRevision
: Version of the Chart to be installed.helm
: optional map of Helm parameters and values
parameters
: optional map specifying parameters to the Helm chart.values
: values to be provided to the Helm chart, to override default values if any.project
: project in which the application is to be created. Project creates a logical
grouping for several applications. default
if not specified.annotations
: optional map describing the application.Use the sync
action to perform a sync operation
on an existing application to bring it to the desired state.
Parameters
app
: name of the app to be synced.revision
: revision of the resource to be synced.resources
: Array of application resources
group
: resource group namekind
: kind of k8s resourcename
: name of the resourcenamespace
: namespace in which the resource is createddryRun
: optional boolean
specifying if the sync operation to be performed
is on an actual environment or a dry run. Defaults to false
.prune
: optional boolean
which enables pruning of resources
as part of the sync operation. Defaults to false
.retryStrategy
: optional map, specifying custom retry strategies
when sync fails.strategy
: optional map, specifying the strategy to be applied
during the sync.watchHealth
: optional boolean
to force the sync operation to wait till
all the components are in healthy state. Defaults to false
.syncTimeout
: optional duration parameter to specify the timeout duration
for the sync operation.Use the patch
action to patch source path
on an existing application and bring it to the desired state.
Parameters
app
: Name of the app to be patchedpatches
: map of the k8s spec with updated source path
```yamlUse the setParams
action to set the application parameters.
Parameters
app
: name of the app for which parameters have to be set or updated.helm
: list of name-value pairs of parameters to be set.
name
: name of the parametervalue
: value of the parameterUse the updateSpec
action to update the application resource object.
Parameters
app
: name of the app which has to be updated.spec
: map of the application k8s resource to be updated.Use the delete
action to delete an application on the Argo CD instance.
Parameters
app
: name of the app to be deleted.cascade
: optional boolean
to perform a cascaded deletion of all
application resources. Defaults to false
.propogationPolicy
: optional string. Specify propagation policy for deletion of
application’s resources. One of: foreground|background (default “foreground”)Use the getProject
action to get the details of a project
present on the Argo CD instance.
Parameters
getProject
: Name of the project to be retrieved.Use the createProject
action to create a project with the provided details
Parameters
project
: Name of the project to be created.upsert
: boolean value (default to false)description
: optional project descriptionannotations
: optional map describing the applicationsourceRepos
: optional sourceRepos contains list of repository
URLs which can be used for deployment. defaults to ‘*’destinations
: optional destinations contains list of destinations
available for deployment. defaults to ‘*’Use the deleteProject
action to delete a project on the Argo CD instance.
Parameters
project
: name of the project to be deleted.Use the getApplicationSet
action to get the details of a applicationSet
present on the Argo CD instance.
Parameters
applicationSet
: Name of the applicationSet to be retrieved.Use the createApplicationSet
action to create a applicationSet with the provided details
Parameters
generators
: Array of objects defines how the applications should generate. More details can be found herepreserveResourcesOnDeletion
: PreserveResourcesOnDeletion will preserve resources on deletion. If PreserveResourcesOnDeletion is set to true, these Applications will not be deleted.strategy
: configures how generated Applications are updated in sequence. More details found hereapplicationSet
: Name of the applicationset to be createdapp
: Name of the application to be created in the applicationset.cluster
: Name of the Kubernetes cluster on which the application is to be created.namespace
: Namespace in which the application is to be created.createNamespace
: optional boolean
when set will force creation of the namespace
specified, if not present.gitRepo
: optional SCM information to which the application will sync. Not required
if helmRepo
is specified.
repoURL
: URL of the SCM RepositorytargetRevision
: Branchname, tag, or commit hash to sync to.path
: The path in the SCM repository which contains Helm charts, application
manifest, or k8s resource definitions.helmRepo
: optional Helm repo information to which the application will sync. Not
required if gitRepo
is specified.
repoURL
: URL of the Helm Repositorychart
: Name of the Helm CharttargetRevision
: Version of the Chart to be installed.helm
: optional map of Helm parameters and values
parameters
: optional map specifying parameters to the Helm chart.values
: values to be provided to the Helm chart, to override default values if any.project
: project in which the application is to be created. Project creates a logical
grouping for several applications. default
if not specified.annotations
: optional map describing the application.Use the deleteApplicationSet
action to delete a ApplicationSet on the Argo CD instance.
Parameters
applicationSet
: name of the applicationSet to be deleted.Note: Minimum Argocd version 2.5 is required for applicationset operations.