fluxcd / flux2-multi-tenancy

Manage multi-tenant clusters with Flux
Apache License 2.0
499 stars 248 forks source link

Question : gotk-components.yaml repetition in multiple clusters #90

Open bluedog13 opened 1 year ago

bluedog13 commented 1 year ago

In the repo, why is the gotk-components.yaml file being created twice for the clusters production and staging? Is it because we are creating a seperate "pods" for respective controllers for both the production and staging environments to ensure common controllers (source, kustomize, helm, notification) won't be a problem?

Production
---
flux2-multi-tenancy/clusters/production/flux-system/gotk-components.yaml
flux2-multi-tenancy/clusters/production/flux-system/gotk-sync.yaml
flux2-multi-tenancy/clusters/production/flux-system/kustomization.yaml

Staging
---
flux2-multi-tenancy/clusters/staging/flux-system/gotk-components.yaml
flux2-multi-tenancy/clusters/staging/flux-system/gotk-sync.yaml
flux2-multi-tenancy/clusters/staging/flux-system/kustomization.yaml

From what I understand, that file will be identical and only the gotk-sync.yaml and kustomiation.yaml files will be different to point to the respective folders to deploy the required resources?

Would something like below make sense

flux2-multi-tenancy/clusters/gotk-components.yaml

Production
---
flux2-multi-tenancy/clusters/production/flux-system/gotk-sync.yaml
flux2-multi-tenancy/clusters/production/flux-system/kustomization.yaml

Staging
---
flux2-multi-tenancy/clusters/staging/flux-system/gotk-sync.yaml
flux2-multi-tenancy/clusters/staging/flux-system/kustomization.yaml

Thanks

stefanprodan commented 1 year ago

We don't recommend reusing the Flux manifests across clusters. If the upgrade fails, all your clusters will be impacted. Instead you would upgrade staging first, check that Flux is Ok there and then do production. Having said that, there is nothing stopping you from having a single gotk-components.yaml which gets imported in all the cluster overlays. You can use the Flux action to automatically upgrade all your clusters at the same time.

bluedog13 commented 1 year ago

Thank you for the answer. This makes perfect sense.