-
Notifications
You must be signed in to change notification settings - Fork 7.2k
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
[Question] Multiple environments(dev, stage, ..,. prod ) example #57
Comments
Please provide a doc describing details of Managing multiple env in argocd. |
Simple question and no answer in 10 months. The app of apps pattern works in most cases pretty good. You need to create a parameterized app template and then the values files for each environment. |
any answers? |
It would be nice to get an answer from argocd |
I also need an answer |
do we any updates on this one? |
Hello. The reason that this question has been not answered, is that there is no standard answer. Most companies do something different and either have an ad-hoc solution or something with an external system or a custom thing over app-of-apps, appset, argo-autopilot etc. As an example, I could provide you with a detailed answer of what we do to address this, until you realize that all my environments are different folders on a single monorepo and my solution depends on this choice. If you have chosen to have different branches per environment for your own case instead, then all my advice is useless to you. And then let's say that you are lucky and I also follow the branch-per-environment practice in git. But then we find out that I am doing git-flow development while you are doing trunk-based development. And then we have to answer this question for Helm, for kustomize, for plain manifests, for people with declarative setup, for people with application sets etc. The possible scenarios get quickly out of hand. By the way this is not a problem specific to Argo CD. It is a problem with GitOps in general. The GitOps working group is now formed (check https://opengitops.dev/) and will soon address all these questions (and more) and establish best practices and standards. |
anyway would be helpful to have an examples directory with various senarious |
@qxmips It is already on my TODO list. Stay tuned :-) |
Here is the example repo https://github.com/kostis-codefresh/gitops-environment-promotion Article with more details about the suggested structure https://codefresh.io/about-gitops/how-to-model-your-gitops-environments-and-promote-releases-between-them/ Article about what to avoid https://codefresh.io/about-gitops/branches-gitops-environments/ Any feedback welcome. |
Thanks a lot
…On Wed, 23 Mar 2022, 6:01 pm Kostis (Codefresh), ***@***.***> wrote:
@qxmips <https://github.com/qxmips> , @emirot <https://github.com/emirot>
, @taybur43 <https://github.com/taybur43>
Here is the the example repo
https://github.com/kostis-codefresh/gitops-environment-promotion
Article with more details about the suggested structure
https://codefresh.io/about-gitops/how-to-model-your-gitops-environments-and-promote-releases-between-them/
Article about what to avoid
https://codefresh.io/about-gitops/branches-gitops-environments/
Any feedback welcome.
—
Reply to this email directly, view it on GitHub
<#57 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKMMWAFT3HA7X6W6GTSPDATVBMBY5ANCNFSM4O3I3OOA>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
@kostis-codefresh , very informative articles and repo, thank you. I'm in the process of implementing what you've suggested, in my employers' projects. I'd like some clarifications on the following points:
|
Hey @ReubenTheDS Thank you for the feedack.
|
@kostis-codefresh Thanks for these really helpful recommendations and your guide! Can you please elaborate a bit on how the single-docker-image approach mentioned above in answer 1. is supposed to work during active development of a product? |
@Jaykob Not sure I understand what you are asking. The "staging" image should be promoted to production at some point. And then both envs are the same. Or are you saying that you have some features that go to staging and stay there? And they never go to production? The original best practice doesn't say that you should be running the same image at all env AT ALL TIMES. It simply says that you should create an image once and then promote it to all environments gradually (instead of building a new image for QA, a new image for staging, a new image for production and so on) |
Ah ok sorry, I misunderstood you on that point. BTW: Do you have good reading recommendations about doing all that with ApplicationSet? |
There isn't a guide similar to mine yet for applicationsets (to the best of my knowledge) But Argo CD itself is adding features to help there. See initial support here https://argo-cd.readthedocs.io/en/stable/operator-manual/applicationset/Progressive-Syncs/ |
@Jaykob Since several people asked me the same thing I also wrote a guide on how to use Application Sets. You can find it here https://codefresh.io/blog/how-to-structure-your-argo-cd-repositories-using-application-sets/ |
@kostis-codefresh Your guide is awesome and answers so many important questions. |
When I add a new deployment should I add it inside the base or should I add it somewhere. For example, I have a microservices application with three services currently running in the production environment. At this point in time, due to business development, a new service is added. If I add it to the base it will be deployed in all environments. However, I just want to deploy it in the test environment. I will only move to the next stage when I have completed the deployment in the test environment. Single branching is great, but what should I do if I run into a situation where I need to roll back a production branch deployment? Should we care about git logging. This is because all the changes are in a single branch, whether they are for the test environment or the qa environment. At this point, the git log should be so large that I can't tell which changes are in production! Please feel free to correct me. Thank you. |
That doesn't happen with the setup I propose in the article. The base folder is not deployed anywhere on its own. Only overlays are in the respective environments.
You run "git revert". Or even better use Argo Rollouts.
Not sure what you mean by "changes". The GitHub repo has only Kubernetes manifests. So commits doesn't say anything about source code changes. Do you mean something else? Feel free to join the argo-cd channel in the CNCF slack instance for even faster communication. |
@kostis-codefresh Thank you so much, I re-read your history article and it solved my problem. When I apply to my production I have a new problem. For example, how should I handle things like database passwords? Is it not a best practice to store it directly in the git repository? I would like to know how you deal with this kind of problem? How do I securely use database passwords? |
The topic of secrets is very popular and there are already several great sources about it. You can store the secrets in Git but in encrypted form using Sealed Secrets. Guide here https://codefresh.io/blog/handle-secrets-like-pro-using-gitops/ Or you can store them outside of Git and fetch them from there. Guide here https://codefresh.io/blog/gitops-secrets-with-argo-cd-hashicorp-vault-and-the-external-secret-operator/ There are many more options for secrets of course. https://argo-cd.readthedocs.io/en/stable/operator-manual/secret-management/ |
Thank you very much @kostis-codefresh You've helped me out a lot. |
Hi there,
I'm getting started with Argocd.
I was able to run great examples, but I don't understand how multiple environments (dev, stage, prod) are managed.
Do I have to create an application for each environment ?
The text was updated successfully, but these errors were encountered: