Replies: 2 comments 8 replies
-
@endophage You can try using sync waves to create service accounts in wave 1 and then other resources in later waves. |
Beta Was this translation helpful? Give feedback.
1 reply
-
Presync can only contain a hook. To do this you would want to put everything in a sync wave so when your sync starts even though you aren’t “presync” anymore your CDN will update on syncwave 0, syncwave 1 will make your service account. Syncwave 2 will run db migrations. Even though you are in the sync phase you can control the order in which the steps happen. |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Maybe I’m missing something in the docs, I have presync hooks that update a CDN and run database migrations. At least for the DB migrations, this aligns with what is suggested in the docs. However, between these 2 hooks, I need a service account (deploying in Amazon’s EKS where the service account provides access to an S3 bucket we front with Cloudfront), and a secret populated from AWS Secrets Manager via aws-secret-operator.
The first time I go to sync that app on a new cluster, the hooks fail to run because Argo doesn’t create the service account or the secret until the Sync phase. So, I have to selectively sync these resources, then run the full sync with everything else. It’s annoying and seems like a really obvious use case.
Is there some way to have specified resources sync during/at the start of the PreSync phase so they’re available for the hooks? It seems like hooks are only meant to be jobs/pods so I haven’t tried simply annotating the resources with the presync hook. Even if that works, what do I do for the delete policy? I don’t want these to ever be deleted, only updated.
Beta Was this translation helpful? Give feedback.
All reactions