-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Support syncing and updating more than one git repository #1164
Comments
Would git subtrees be of help here? After all, they do allow you to in effect aggregate multiple repos into one. |
Maybe, but I'm not sure it would be the simplest way to accomplish this. (Genuinely not sure, rather than British not sure) |
We're exactly in the first use case and we have multiple repositories.
Keeping the "config" with the code allows the devs to work in a single place on the project and on how it is deployed. Let's suppose you deploy 50 projects in a given namespace and you want to keep the helm charts (that's what we're using) along with the code. Does it mean you'll have 50 operators in the same namespace ? and how about the helm-operator ? I guess there's some work to do if you want to keep a single tiller. I'm looking for advices on the best setup in my case. I'm going to explore 2 options:
Help is welcome :) |
I managed to have something that fits my needs. I've create a very simple operator that deploy fluxes :)
Todo:
|
@Smana what it scares me with that approach is that you need to have a flux for each service that you want to deploy. Basically, you need to double the resources in your cluster just to accommodate flux 😱. If you have 50 microservices, you need to have 50 different flux daemons running. So you will eat your cluster resources faster. I think at the moment the only feasible approach is to have mono repos. |
@mazzy89 I understand your concerns, but I can't change what's has been build for years and the current status of the github repositories in my current.
Todo:
But yes, I agree, we'll have number of couples flux/helm-operator :
|
My use case is relatively simple: I'd like to have most of my configuration live in an open source repository, and then just have secrets live in a private repository. Multiple repositories seems like the easiest way to accomplish this, but I may be missing something obvious |
Has anyone seen a pattern for compiling k8s manifests from multiple repositories using something like jsonnet (or the late ksonnet)? https://jsonnet.org/ With features like “flux release”, it certainly seems like flux intends to treat application source code as a first class citizen, but by doing so flux is biting off more than it can (or should?) chew. If flux is just a tool for managing cluster state, it’s fair to say that flux only needs to be concerned with one repo - the “cluster repo”. Leave it to users to figure out how to populate that repo with their “fully compiled” k8s manifests. But if flux is a tool for managing cluster state AND releasing applications (among other things),, then it must be able to handle resolving resources from multiple repositories. |
We keep our configs side by side the code, each workload in its own repo. We also would like to use GitFlow with different branches in each of those repos applying to different namespaces in our cluster. |
I am confused. Does https://github.com/fluxcd/multi-tenancy solve this issue or not? |
It does kind of solve this by spawning multiple Flux daemons, this issue is however about supporting multiple git repositories with one Flux daemon, which the mentioned repository does not solve. |
We would really like to see this. This would allow our users to be restricted to making changes to only the submodule code, not the entire cluster. |
Would it be possible to use a CRD to define flux-requirements per namespace? A team which is restricted to only change things in a certain namespace could add a CRD (e.g. "flux") to that namespace, containing information about the git repository used as source for kubernetes resources in that namespace and a service account with the privileges to execute deployments. This approach has multiple advantages. It would allow to use multiple repositories with only one flux operator running and watching repositories. (Less resource usage and less maintenance) |
@mheck136 that design seems like the optimal architecture to me. 1 operator -> 1-many CRs -> ephemeral pods (via Jobs most likely) to execute the actual work when needed -> when sync complete, pod goes away, job deleted EDIT: Another benefit is that the |
I've been trying to adopt flux in my organization (one kubernetes cluster hosting several apps by multiple teams) and the only thing that's preventing me is that I always find myself in need of multiple flux instances, which seems very inneficient in terms of resource usage. Since all my deployments today use kustomize it took me a while to think about taking a deeper look at the helm operator. I did it now and it seems to me that could be a way forward. Could the same approach be used for kustomize-based deployments ? Something like a "generalized" helm operator ? Not sure whether @mheck136 was thinking the same thing, i.e., having flux (daemon) and a flux (operator). To be precise, the helm operator depends on flux to keep the CRDs in sync so it is still limited to a single git repo for that. The CRDs, however, can refer to other repos. |
Hello Team. Do you have a plan to implement this? |
Implemented in Flux v2 https://github.com/fluxcd/flux2 Docs here https://toolkit.fluxcd.io/components/source/gitrepositories/#spec-examples |
From time to time people say that it would be handy if flux supported syncing with more than one repo.
These are use cases:
These are not use cases:
Also see #1139.
The text was updated successfully, but these errors were encountered: