gimlet-io / gimlet

Deployment tool built on Kubernetes to make the deploy, preview and rollback workflows accessible to everyone.
https://gimlet.io
Other
323 stars 27 forks source link

Provisioning cloud resources #462

Open laszlocph opened 1 year ago

laszlocph commented 1 year ago

The goal of this issue is to develop support of provisioning cloud resources through the Gimlet manifest file.

The scope of cloud resources are limited to items that developers care about:

The technical implementation will be Crossplane compositions and / or Terraform modules.

The vision

Considerations

laszlocph commented 1 year ago

Currently we refer to helm charts in the chart field and we store the values for it

We introduce a new section where we can reference compositions and tf modules with their input parameters.

app: test-app
env: random6
namespace: default
chart:
  repository: https://chart.onechart.dev
  name: onechart
  version: 0.41.0
values:
  gitRepository: gimlet-io/test-app
  gitSha: '{{ .SHA }}'
  replicas: 2
strategicMergePatches: ""
json6902Patches: []
manifests: ""
+ dependencies:
+-  name: my-db
+   composition: https://github.com/gimlet-io/compositions?tag=v1.0.0&path=aws/rds
+   values:
+     size: 10GB
+-  name: my-redis
+   tfmodule: https://github.com/gimlet-io/tfmodules?tag=v1.0.0&path=aws/elasticache
+   values:
+     size: 1GB
tcrst commented 1 year ago

GitOps everything

Git should also serve as the single source of truth for all cloud infrastructure changes. Implementing GitOps for cloud infrastructure management will lead to enhanced visibility and change tracking, automated provisioning, improved teams collaboration, increased security, and easier maintenance.

It's common for applications to have dependencies on various cloud infra components. These dependencies can include databases, message queues, caches, storage systems, and other services. Using a shared manifest for applications and infrastructure changes through GitOps can improve the overall collaboration, consistency and traceability, it simplifies the CI/CD workflow and can also improve disaster recovering since all the changes are tracked into a single place.

Considerations:

🤔

laszlocph commented 1 year ago

You are spot on @tcrst!

  • all the infrastructure changes and plan outputs must be shown in the PR approval review and will be applied on the merge of the PR

good thinking, agreed

  • every tfmodule should have his own statefile ( inherite backend configuration from env )

I was not thinking any of the specifics of TF, but this seems like a good idea. Let's adopt this for the first version.

applications should be able to access manifest deps outputs or general infra env outputs

Good point. We should see how the Terraform controller for Flux works. I suspect there is a CRD and the state of the CRD will hold this info.

laszlocph commented 1 year ago

https://github.com/gimlet-io/gimlet/pull/504 introduced basic Terraform support in the Gimlet manifest