Replies: 4 comments 2 replies
-
+1 for this. FluxCD supports this: https://fluxcd.io/flux/components/kustomize/kustomizations/#post-build-variable-substitution |
Beta Was this translation helpful? Give feedback.
-
this would violate gitops core principles, as files with such substitutions are not fully declarative anymore because you can't apply them with kubectl oder build them witt kustomize anymore without an imperative process which substitutes those variables. what flux did there is really really bad, that just shows that they didn't understand what gitops means and how its implemented. i highly recommend to not integrate such an 'feature' into argocd, if this gets integrated it MUST be possible to disable this 'feature' via config. |
Beta Was this translation helpful? Give feedback.
-
Thank you for your feedback. Let me elaborate on the explanation. I believe the variable substitution feature would be beneficial in the following situation: Let’s say we have 50 teams, and each team has three environments: dev, stage, and prod, using Kustomization. There is a variable,
With FluxCD, you can handle this by using variable substitution as follows:
Without this feature, you could still use Kustomize patches to set up the configuration for each team and environment. However, each team would need to write the setting for their specific environment, which means you’d have to write the If ArgoCD does not have variable substitution, how would it handle this situation? (Sorry, I'm still a beginner of ArgoCD and there would be a better idea to handle this. 🙇 ) FluxCD, of course, allows you to disable this feature by not configuring the post-build-variable-substitution setting. (It will not be used if you don’t set it: https://fluxcd.io/flux/components/kustomize/kustomizations/#post-build-variable-substitution) Thank you! |
Beta Was this translation helpful? Give feedback.
-
Regardless of the GitOps principles, what you are asking is an overkill because you are trying to add another templating layer on top of Helm and application sets. I have written about this here https://codefresh.io/blog/how-to-structure-your-argo-cd-repositories-using-application-sets/ (check -antipatterns 1 and 2 in that article). The solution is to use Helm value hierarchies (in case of Helm) and Kustomize components in case of Kustomize. |
Beta Was this translation helpful? Give feedback.
-
I have an argocd application
https://argo-cd.readthedocs.io/en/stable/user-guide/multiple_sources/
my values.yaml looks like this
is there some way for me to inject the value of db_name into the .yaml
Such that any occurrence of ${db_name} found in the .yaml will get substituted for a value.
Beta Was this translation helpful? Give feedback.
All reactions