weave-gitops icon indicating copy to clipboard operation
weave-gitops copied to clipboard

Add source and kustomization for reconciliation loop after turning off sync

Open JamWils opened this issue 2 years ago • 0 comments

As a user when I am done running gitops run I want to be able to transition my workloads to a gitops workflow. This means I need to have the necessary pieces on the cluster and in my repo so I can have a reconciliation loop.

Make sure to use Github issue to view mermaid diagram below: https://github.com/weaveworks/weave-gitops/issues/2368

Fresh install on Cluster

sequenceDiagram;
    participant User;
    participant GitOps Run;
    participant Config Repo;
    participant Cluster;
    User ->> Config Repo: Run `git init`;
    User ->> GitOps Run: Run `gitops run`;
    GitOps Run ->> Cluster: Flux controllers and CRDs are installed;
    GitOps Run ->> Config Repo: Manifests for flux-system are saved to disk;
    User ->> GitOps Run: ctrl+c `gitops run`;
    GitOps Run ->> Config Repo: Gets info about repo such as default branch;
    GitOps Run ->> Cluster: Creates reconciliation loop with Source and Kustomization;
    GitOps Run ->> Cluster: Cleanup temporary bucket and workload
    GitOps Run ->> GitOps Run: End process;
    User ->> Config Repo: Push to remote;
    Cluster ->> Config Repo: Pulls files from remote;
    Cluster ->> Cluster: Create workloads based on pulled CRDs;
    User ->> Cluster: The user can see the workloads on the cluster;
    User ->> User: GitOps...alright, alright, alright!

While the events above do not have to be done in that particular order you can see the end result. As a user, I will have transitioned over to a GitOps workflow and can commits my changes accordingly.

Is it an error to run sync on a repo w/ more than one remote? Yes, initially. We can work on handing these scenarios in a future story.

If you run git init w/o remote? <-- need a warning that we cannot transition to gitops successfully when gitops run is done.

When we install the manifests we would put them in ./clusters/<cluster-name>/flux-system. We create the flux-system folder relative to the --path argument.

When I open a PR and merge it to the default branch I should see those manifests get created and synced onto the cluster.

JamWils avatar Jun 23 '22 17:06 JamWils