I'm currently working on setting up an ArgoCD deployment using the App-of-Apps pattern. In my scenario, I have a Strimzi application and a Kafka application as part of the umbrella application. The issue I'm facing is related to the synchronization order. The Strimzi child app needs to be healthy before the Kafka app syncs because the Kafka CRDs are installed by the Strimzi app.
Here's a simplified version of my deployment script:
NS=argocd
argocd login --core
kubectl config set-context --current --namespace="$NS"
# Create fink app
argocd app create fink --dest-server https://kubernetes.default.svc \
--dest-namespace "$NS" \
--repo https://github.com/astrolabsoftware/fink-cd.git \
--path apps --revision "$FINK_CD_WORKBRANCH" \
# Sync fink app-of-apps
argocd app sync fink
# Sync child apps
# Is there a way to remove 5 lines below and keep only the 6th
# for example using sync-waves?
argocd app sync strimzi
while ! kubectl wait --for condition=established --timeout=60s crd/kafkas.kafka.strimzi.io crd/kafkatopics.kafka.strimzi.io
do
sleep 5
done
argocd app sync -l app.kubernetes.io/instance=fink
The problem is that if the Kafka app syncs first, it fails because the Kafka CRDs are missing, and they are supposed to be installed by the Strimzi app.
How can I ensure that the Strimzi child app is healthy before the Kafka app syncs when using the ArgoCD App-of-Apps pattern? Are there any specific syncPolicy configurations or strategies that can help me achieve the desired synchronization order?
Any insights or suggestions would be greatly appreciated. Thanks in advance!
ArgoCD provides the ability to synchronize resources in certain order: Sync Phases and Waves
You would need to annotate your Strimzi application as follows:
Where X should be higher than 0 which is the default value for all resources.
It is not possible to annotate applications inline using ArgoCD CLI. It would be better to define the applications themselves first and then create them in the cluster.
Example, an
applications.yamlfile that holds the definition of the application that installs the CRDs,kafka-strimzi-crdsand an application that uses these CRDs to create a Kafka Clusterkafka-strimzi-cluster, both in thekafkanamespace:And running
kubectl apply -f applications.yaml