shalb / cluster.dev

Cloud-native infrastructure templating. Creating cloud installers for SaaS. Replication of complex cloud-native infrastructures.
https://docs.cluster.dev/
GNU Affero General Public License v3.0
401 stars 36 forks source link

[Feature] Passing variables and outputs between different projects #253

Closed kinseii closed 5 months ago

kinseii commented 5 months ago

What would you like to add I really enjoyed the project, looking forward to implementing this in our fifty+ environments. However, the only thing stopping me is the fact that we won't be able to pass variables and outputs (Such as similar functions of terragrunt: read_terragrunt_config and dependency) between projects. Please provide such a feature.

voatsap commented 5 months ago

@kinseii thanks for proposal we are checking posibility of this feature, woud back in short time about it.

voatsap commented 5 months ago

@kinseii I have reviewed the proposed functionality, and I wondering regarding the use case.

  1. Basicly Project abstraction cover individual group of Stacks, Its possible to access variables and outputs between the Stacks, https://docs.cluster.dev/variables/#passing-variables-across-stacks Stack could host a quite large infrastructure Template and you can have even 50+ infrastructures under the one project with multiple stacks. Project we think as an global entity to define whole cloud account or environmental entity like Dev/Stage/Prod.

So can you please provide more details or use-cases why you need?

  1. Regarding features you see in terragrunt, like dependency, we do have depends_on, Example: https://docs.cluster.dev/units-kubernetes/

    - name: argocd_apps
    type: kubernetes
    source: ./argocd-apps/app1.yaml
    kubeconfig: ../kubeconfig
    depends_on: this.argocd

    Also our graph is quite strong to resolve most of dependencies, and this could be used only in rare situations.

  2. Regarding functionality like read_terragrunt_config, we can't implement this due to declarative style of our manifests. We plan to support K8s reconcilation, so we can't rely on path'es of manifests. Maybe your requirement could be workarounded with https://docs.cluster.dev/stack-templates-functions/#readfile function.

kinseii commented 5 months ago

OK, we'll try to do it as part of the project.