How Should I Organize GitOps Repositories for Multiple Projects?

0
8
Asked By TechWanderer92 On

I'm currently managing GitOps for an EKS cluster that hosts around 17 microservices all tied to a single project. We've set up a repository that's monitored by ArgoCD, utilizing Kustomize with an overlays directory to manage the manifests for each microservice. Here's how our directory structure looks: Base Directory -> Directory per Microservice -> Overlays -> Env Directories -> Microservice directories -> Kustomize Overlays.

I'm trying to decide whether to create a separate GitOps repository for each project and have ArgoCD monitor all of them, or to stick with a monorepo approach and further categorize the directories, something like: Base Directory -> Project Directories -> Microservice Directories.

My concern with the monorepo setup is that as we add more projects, it could lead to multiple users making changes in the same repository, which could complicate things. What do you all think is the best practice for structuring these repositories for scalability and manageability?

5 Answers

Answered By CodeBenderX On

I personally prefer to keep all my GitOps stuff in one repo. It makes coordinating global changes a breeze. Plus, you can use CODEOWNERS to ensure that each team is only managing their own files, which mitigates some of the chaos.

Answered By ArchitectAndy On

When determining your repo structure, think about ownership and blast radius rather than just counting apps. If all 17 services are owned by the same team and shipped together, a monorepo might make sense. However, if different teams need to evolve independently, split the repos accordingly. ArgoCD is flexible with repo counts, but for human management, it's crucial to keep reviews organized and avoid conflicts during cross-cutting changes.

Answered By MicroserviceMaestro On

In my experience, it's usually better to keep a GitOps repo for each system or project rather than trying to squeeze everything into a monorepo. This keeps it cleaner and prevents too many people from interfering in one place, which can lead to issues down the road. Argo CD works well with multiple repos, so I recommend this approach.

Answered By BuilderNinja On

Most teams I’ve observed tend to land somewhere in between. It's common to have one repo per project, which scales better for ownership and limits the impact of changes (blast radius). That said, having a small 'platform' repo for shared configurations or policies can also be beneficial. Monorepos might look tidy initially, but they can turn into a coordination nightmare when multiple teams are pushing changes.

Answered By DevOpsGuru77 On

One effective approach I've seen is to have separate repositories for each project but with a structured shared configuration. There are nice templates out there that can help you set this up quickly. Each buildable unit gets its own repository, so you maintain clarity in change history and management. This also allows for easier troubleshooting and deployments since everything is clearly delineated. Plus, ArgoCD can handle multiple repos easily, so you can scale without it getting messy.

Related Questions

LEAVE A REPLY

Please enter your comment!
Please enter your name here

This site uses Akismet to reduce spam. Learn how your comment data is processed.