DEV Community

Cover image for Code Organisation Strategy for GitOps
Mezbaur Rahman
Mezbaur Rahman

Posted on

Code Organisation Strategy for GitOps

One of the most often question is: Is GitOps just another way of doing CI/CD? The answer to this question is simply NO. GitOps only takes care of the CD part, the delivery part. To achieve this, one would think about organising the repo structure. So, you would maintain 3 different repos to main:

  • GitOps Fleet
  • Project Deployment
  • Project/App Source

GitOps Fleet Repository to manage organisation wide deployments to Kubernetes with FluxCD. This repository would contain

  • Cluster Configuration
  • Cluster Wide Infrastructure Components e.g. Ingress Controllers, Repository Secrets etc.
  • Project onboarding configurations aka. tenants spec.

Project Deployment Repository (tenant). This repository would contain k8s manifests for

  • infra
  • app and
  • pipelines/tekton

The code could be either

  • Helm charts source code
  • YAML Manifests as either
    • Plain YAML
    • Kustomize Overlays

Project/App Source Repository

  • Application Source Code
  • Contains Source Code + Dockerfile etc.

Now, the following diagram shows the code organisation strategy described above, above with a clear separation of the CI and CD stages.

Image description

note: I have taken encouragement from this example.

Top comments (0)