akuity / kargo

Application lifecycle orchestration
https://kargo.akuity.io/
Apache License 2.0
1.5k stars 132 forks source link

Support of rendering to another repository #1354

Open dan1el-k opened 8 months ago

dan1el-k commented 8 months ago

Checklist

Proposed Feature

Rendering to a another repository. (Service Repo concept)

Motivation

As of version 0.3.0 kargo, just supports rendering in branches of the same repository as the source helm or kustomize files exists.

This is fine and supported for:

What I would like to have is the support of:

With that, this Service repocould be a pure pipeline/infrastructure repo with no manual changes need after setup, and the application repos(multiple, one for each microservice) are used as a source and working repo for the team/engineers.

Suggested Implementation

Support of following new parameters

Full example

apiVersion: kargo.akuity.io/v1alpha1
kind: Stage
metadata:
  name: dev
  namespace: kargo-demo-service
spec:
  subscriptions:
    warehouse: demo-kustomize
  promotionMechanisms:
    gitRepoUpdates:
    - readRepoURL: https://gh-enterprise.com/my-org/kargo-demo-kustomize
      readBranch: main
      writeRepoURL: https://gh-enterprise.com/my-org/kargo-demo-service
      writeBranch: stage/dev
      render:
        images:
        - image: artifacts.my-comp/docker/my-org/cortex-template-kustomize-application/nginx
krancour commented 8 months ago

Hi @dan1el-k! This is an interesting idea.

I want to try and split this into two different parts.

  1. There's the more general aspect of this, where you might want to to do this for any gitRepoUpdate -- i.e. not limited to Kargo Render.

  2. Then there's the Kargo Render-specific aspect of this, which is the harder one for me to wrap my head around. One of the fundamental premises of Kargo Render is that Kargo Render configuration is "close" to the source it operates on and to the branches it renders. i.e. If you were looking at repo, you would see what got rendered, what it got rendered from, and what the rules were for doing that, all in one place.

While this generally seems doable, it upsets the apple cart a little bit in terms of that fundamental premise of Kargo Render.

I think before either committing (or not committing to this), I'd like to get a sense of how common a pattern it is to read config management templates/overlays from one repo and render them to another. Let's leave this open and see where it goes.

Tangentially: idk if this other thread of yours and mine might give you an alternative way to approach this?

dan1el-k commented 7 months ago

In the enterprise company I am working in, teams uses different repo patterns, based on size and complexity of the applications.

kargo_monorepo

kargo_mono-manifest

kargo_servicerepo


While the first 2 patterns are perfectly supported by kargo, I am specifically targeting the 3rd one with this request.

Yes, this could potentially be achieved as well using Kustomize remote base or an Helm umbrella chart with dependencies or via Git Submodules out of the service repo, as I have requested with my other ticket in "kargo-render" project. I do believe however, that a native support to render to a remote repo is easier to configure and grasp for the enduser

MarkusNeuron commented 7 months ago

Hi, this proposal is a pattern we also want to support. Besides collecting and rendering multiple repos to one service to have the deployed state of the service audited at every point in time. Taking this idea even further you could render all manifests to a cluster repo to archive the same on cluster level.

mihaigalos commented 7 months ago

I'm tentatively contributing a WIP PoC in https://github.com/akuity/kargo/pull/1447.

github-actions[bot] commented 4 months ago

This issue has been automatically marked as stale because it had no activity for 90 days. It will be closed if no activity occurs in the next 30 days but can be reopened if it becomes relevant again.

krancour commented 4 months ago

Not stale. I think this is something we can tentatively do, but it's a more involved change than it may seem on the surface. Priority still undetermined.

dan1el-k commented 1 month ago

Hey @krancour, Is there any update on this ticket ? were you able to discuss this further in the round of maintainers ? Thanks.

krancour commented 1 month ago

In v0.9.0, we plan to break up our "russian nesting doll" of opinionated promotion mechanisms into an ordered sequence of more granular, more explicit, user-defined steps. It is largely a guess, but this issue may be solved incidentally by those plans.

krancour commented 2 weeks ago

Following up on previous comment. I do expect that this will be addressed naturally by #2219