-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with Pre-Upgrade Hook in Ziti Router Chart When Using ArgoCD #290
Issue with Pre-Upgrade Hook in Ziti Router Chart When Using ArgoCD #290
Conversation
orthogonal to issue #272 |
What if, instead of a surgical toggle for specific resources, we update the docs to emphasize that Helm hooks are not applicable when not deploying the rendered manifest with For example: GitOpsYou can use Helm to render the manifest and deploy it later with your preferred GitOps toolchain, e.g., Helm => Kustomize => ArgoCD => K8S. Importantly, life cycle hooks, e.g., pre-upgrade jobs, are not applicable unless you are deploying with Helm. You must render the templates without hooks and supply any missing values or resources when deploying another way, e.g., a GitOps agent. helm template --no-hooks We could have a GitOps section like this in each chart's |
@qrkourier, In my scenario, I'm using a list generator in ArgoCD to create Ziti networks. This setup allows me to add an element to a YAML list, which then automatically spins up a new Ziti network within the Kubernetes cluster. Adopting your solution would require moving all the logic currently managed by ArgoCD's ApplicationSets and Generators into an upstream pipeline. Having this extra upstream pipeline, only to avoid the execution of a helm hook, does not seem justified to me. Additionally other projects like karpenter and hpe-storage seem to also either implement a toggle or even remove the hook - argoproj/argo-cd#4331 Probably we can move all the chart resources into one yaml file, while separating the resources with document separators ( |
But I also think that it would still be beneficial to document the reason why this 'toggle' is there and definitely set the default in a way that the helm hook gets executed. So in case someone just wants to get the chart deployed and does not care about GitOps practices with tools like ArgoCD, the migration, which the hook is intended for, will take place without requiring the user to change any values. This would then lead to the chart behaving the same way as before, while giving more experienced users the option to use the chart in more advanced scenarios also :) |
@jan94 Thanks for clarifying that ArgoCD users are not necessarily running Yes, I prefer a single, broad bool that has the same effect as Thank you for solving this problem! |
So If I understand you correctly, you want me to move all the resources which should be omitted into one yaml file sth. like |
I was of the impression that you had already worked with ArgoCD. If I had known that, I could have explained better/more about Argo. :) You're welcome, as always. :) |
Hrrm. 🤔 Would it be better to consolidate those templates than to continue with the template file naming convention? It seems simple enough to wrap each resource with a bool condition keying upon I haven't surveyed how other projects have addressed this issue. If we can use an elegant pattern, that's preferable, even if it means moving around the template files. |
from ref: https://argo-cd.readthedocs.io/en/stable/user-guide/helm/#helm-hooks |
https://argo-cd.readthedocs.io/en/stable/user-guide/helm/#helm-hooks -> yes that is exactly what I was referring to when opening the PR :)
This is basically the issue one has, when working with ArgoCD and helm charts that have pre-install or pre-upgrade hooks.
That seems to work on an "per-resource" level. In theory it is possibly to set an ArgoCD hook on the pre-upgrade job, but the only hook feasible from ArgoCD would be the post-sync one - which is also not the right time to execute that hook in this case of the router-chart. |
I agree, it is not necessary to merge all related resources into one file - I just thought that would be sth. that you prefer, because you meant that the bool seems 'surgical' ;) I'm am not aware of any more elegant pattern for this use-case. |
@qrkourier, |
153cf10
to
288b6d6
Compare
288b6d6
to
8d7b82d
Compare
I forgot to bump the router chart version, and apparently, that check doesn't run on fork PRs for some reason. |
Hi @qrkourier,
I am in the process of deploying the Ziti router chart via ArgoCD and have encountered an issue with the pre-upgrade hook in the router chart. This issue renders the chart unusable with ArgoCD because ArgoCD cannot distinguish between the Helm hooks pre-install and pre-upgrade (as detailed in this issue and the ArgoCD documentation).
Problem:
ArgoCD initiates the pre-upgrade hook—which depends on the PVC created by the chart—even during the initial deployment. At this stage, no Persistent Volume Claim (PVC) has been created yet, causing the pre-upgrade hook to fail and preventing the deployment from succeeding.
Proposal:
To resolve this issue, I propose adding an option in the chart's values file to omit the identity migration pre-upgrade hook. This hook is only necessary when migration is actually required.
Benefit:
BR
Jan