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
I have few apps (helm charts) combined by one helm chart.
Some of child charts have helm hooks for db init/migrations
In top level chart I created ns template:
My problem that child helm hooks executed before namespace creation:
GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
batch Job review-app1 xx-db-init Failed SyncFailed PreSync namespaces "review-app1" not found
batch Job review-app1 yy-db-init Failed SyncFailed PreSync namespaces "review-app1" not found
batch Job review-app1 zz-db-init Failed SyncFailed PreSync namespaces "review-app1" not found
ConfigMap review-app1 xx-config OutOfSync Missing
ConfigMap review-app1 yy-config OutOfSync Missing
even with "-100" sync wave priority
I tried add to ns definition
argocd.argoproj.io/hook: PreSync
It works well only for first deployment, all next fails with:
GROUP KIND NAMESPACE NAME STATUS HEALTH HOOK MESSAGE
Namespace review-app1 review-app1 Error PreSync failed to delete resource: Operation cannot be fulfilled on namespaces "review-app1": The system is ensuring all content is removed from this namespace. Upon completion, this namespace will automatically be purged by the system.
I have this same problem, currently I am creating the namespace manually beforehand but it really needs to be a feature in ArgoCD. There is discussion here: #1809
You can create the namespace the way you want to by adding a preinstall hook annotation to the namespace template, however when the application is synced, the namespace gets auto-deleted. I haven't found a way around this yet. Maybe I'll just create a helm chart that just creates the namespaces and sync that before syncing the application.
Ok, if you don't use preinstall hooks at all, it works with at least ArgoCD version 1.8. Then the namespace is created prior to everything else. But, preinstall hooks won't work then.
argocd version
.Describe the bug
I have few apps (helm charts) combined by one helm chart.
Some of child charts have helm hooks for db init/migrations
In top level chart I created ns template:
My problem that child helm hooks executed before namespace creation:
even with "-100" sync wave priority
I tried add to ns definition
It works well only for first deployment, all next fails with:
To Reproduce
Add child helm charts with hooks like:
Expected behavior
Namespace should be created before helm hooks
Version
The text was updated successfully, but these errors were encountered: