Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solving a chicken-and-egg problem when using Flux pointed to a in-cluster slef-hosted Gitlab that doesn't exist yet? #1504

Closed
nogweii opened this issue Jun 6, 2024 · 4 comments
Labels
invalid This doesn't seem right

Comments

@nogweii
Copy link

nogweii commented Jun 6, 2024

I have a local git repository on my laptop that has a bunch of manifests to deploy Gitlab, among other apps, to my Kubernetes cluster. The cluster is pretty much empty, as it is a freshly made one using Talos. I'd like Flux to point to my Gitlab installation using a GitRepository but that Gitlab server doesn't exist yet as the manifests haven't been applied. I do not want to host this repo in an external service, I want to keep it private.

What options are there to resolve this? Is there an API I can upload a compressed snapshot of the repo to a controller to seed it?

@makkes
Copy link
Member

makkes commented Jun 6, 2024

Generally, you don't need Git to use Flux. source-controller can consume artifacts from S3 or OCI, too.

@nogweii
Copy link
Author

nogweii commented Jun 6, 2024

Fair point, but still suggests a similar situation - if I'm deploying Minio or Harbor (as examples) via Flux, how do I solve that situation? I don't have an S3 bucket or OCI registry yet to upload to.

@stefanprodan
Copy link
Member

The whole point of Flux and GitOps is that the cluster state is stored outside of the cluster. Please close this and open a discussion if you like https://github.com/fluxcd/flux2/discussions, this is not something suitable for an issue in source-controller.

@stefanprodan stefanprodan added the invalid This doesn't seem right label Jun 6, 2024
@nogweii nogweii closed this as not planned Won't fix, can't repro, duplicate, stale Jun 6, 2024
@kingdonb
Copy link
Member

kingdonb commented Jun 6, 2024

You will always have a chicken-and-egg problem if you try to put your source of truth inside of the cluster. There is no way for Source Controller to deliver an artifact that comes from anywhere else than where you have pointed a Source.

You can upload an artifact to a GitHub OCI registry (it's free) and use it to seed the bootstrap.

Any scheme where you're taking a snapshot and exporting it to use as a surrogate or temporary source of truth is going to have the risk that it will become out of sync with the definition in your ultimate source of truth.

(That difference might not matter at all, or it might be the critical part of how the "external bootstrap seed" works - for self-hosted cluster with an internal source of truth.)

I created, to follow up this thread:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

4 participants