Hello, I have a question of how ArgoCD should you setup it one application when . . .

Thiago A.:
Hello, I have a question of how ArgoCD should you setup it one application when you have all environments, let’s say dev, test, prod (one per namespace) in the same cluster. Should you create one config repo with the overlays plus one git repo with the generated manifest for each environment?

Abrar Ali:
https://developers.redhat.com/articles/2022/09/07/how-set-your-gitops-directory-structure#directory_structures

Abrar Ali:
Something like this would work for your requirements:

├── bootstrap

│   ├── base

│   └── overlays

│       └── default

├── components

│   ├── applicationsets

│   └── argocdproj

├── core

│   ├── gitops-controller

│   └── sample-admin-workload

└── apps

      ├── bgd-blue

      │   ├── base

      │   └── overlays

      │       ├── dev

      │       ├── prod

      │       └── stage

      └── myapp

          ├── base

         └── overlays

           ├── dev

           ├── prod

           └── stage

Thiago A.:
this structure is clear for me, that setup on ArgoCD that I want to know what to do… going back to my question do I need to create one repository for each overlay generate manifests and add each of them on argocd?

how would argocd handle it in that case, since I have myapp on dev and stage at the same time, it would conflict from ArgoCD applications perspective.

Abrar Ali:
It is generally a good practice to have one Git repository for each environment when using Argo CD. This way, you can have separate configuration and manifest files for each environment, and you can easily track and manage the changes made to each environment.
Here is an example of how you could set up Argo CD for an application with multiple environments in the same cluster:

  1. Create a separate Git repository for each environment (e.g., dev, test, prod).
  2. In each repository, create a directory for the application and place the configuration and manifest files for that environment in that directory.
  3. Use overlays to customize the configuration and manifest files for each environment. For example, you might use overlays to set different resource limits or to specify different environment variables for each environment.
  4. Use Argo CD to deploy the application to each environment by specifying the appropriate Git repository and directory for that environment.
    By using this approach, you can easily manage and track the changes made to each environment, and you can easily switch between environments by simply selecting a different Git repository in Argo CD.

Thiago A.:
Thanks a lot @Abrar Ali I will try on my own and see what happens =)