Synchronization principles
The sync phase of Argo CD is one of the most important operations and can become powerful if you use Resource hooks and Sync waves. This section will explain in detail these operations and you can see the unlimited power it can give you in a real environment.
Resource hooks
As we described in a previous section, sync is the phase for moving an application to the target state which happens by applying the changes in the Kubernetes cluster and this operation is executed by Argo CD in a number of steps. The phases of sync are as follows:
- Pre-sync
- Sync
- Post-sync
These are called resource hooks which give us the power to run any other operation before, during or after the sync phase.
- Using a PreSync hook to perform any action which needed to be done before the Sync phase. A typical example is database migration as we need to run first the migrations.
- Using Skip indicates to Argo CD to skip the application of the manifest.
- Using a Sync hook to orchestrate a complex...