fluxcd / flux2-kustomize-helm-example

A GitOps workflow example for multi-env deployments with Flux, Kustomize and Helm.
https://fluxcd.io
Apache License 2.0
961 stars 1.03k forks source link

An example with a second app ? #5

Closed cebidhem closed 3 years ago

cebidhem commented 3 years ago

Hey,

I get the concept of this DRY example for Helm releases. Now it is fairly simple with a single app, but if we were to add another app let's say, only deployed in staging that require a postgreSQL db, how would it look like ?

I guess I'm trying to understand how do DRY in my context, without giving unnecessary overhead for any new team joiner in the future. So the simplest would be declare your app in each cluster folder. Easy to read, not that painful to maintain, but quite a lot of copy/paste.

So given your example and the need above, would it look like this (removed the things that don't change for clarity of the purpose):

flux-example
├── apps
│   ├── base
│   │   ├── myapp
│   │   │   ├── kustomization.yaml
│   │   │   ├── namespace.yaml
│   │   │   └── release.yaml
│   │   └── podinfo
│   │       ├── kustomization.yaml
│   │       ├── namespace.yaml
│   │       └── release.yaml
│   └── staging
│       ├── myapp
│       │   ├── kustomization.yaml
│       │   └── myapp-values.yaml
│       └── podinfo
│           ├── kustomization.yaml
│           └── podinfo-values.yaml
└── infrastructure
    └── postgre
        ├── kustomization.yaml
        ├── namespace.yaml
        └── release.yaml

9 directories, 13 files

I'm not trying to fit any best practice and I do understand it's up to us to define our repo structure to fit our needs, but I'm trying to get if I understood it correctly because a good start is important I guess if we are to deploy tens of charts with flux.

cebidhem commented 3 years ago

We've actually figured this out after some try and fails :)

espizo commented 2 years ago

@cebidhem Did you go with the layout above, or something else?