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

General questions #328

Open
szihai opened this issue Jul 5, 2022 · 3 comments
Open

General questions #328

szihai opened this issue Jul 5, 2022 · 3 comments

Comments

@szihai
Copy link

szihai commented Jul 5, 2022

It's an interesting project. I have some questions:
a. Terraform handles states by comparing snapshots. Will adding a controller, which constantly checks the snapshots, overreact to situations like networking outage and change or even destroy the cloud resources?

b. About user experience: Most real world terraform applications use modules. How do you plan to support modules? Can users provide multiple json files based on multiple module state files? Or do users have to provide dozens of resource yamls?

@chivalryq
Copy link
Member

a. Terraform handles states by comparing snapshots. Will adding a controller, which constantly checks the snapshots, overreact to situations like networking outage and change or even destroy the cloud resources?

Terraform-controller won't constantly check the snapshot for now.

b. About user experience: Most real world terraform applications use modules. How do you plan to support modules? Can users provide multiple json files based on multiple module state files? Or do users have to provide dozens of resource yamls?

In Configuration CRD, you can specify a module's URL. And what do you mean by "Can users provide multiple json files based on multiple module state files?"

@szihai
Copy link
Author

szihai commented Jul 10, 2022

On the user experience, my question is about how do you handle complex modules and dependencies between modules?
Image I use Terraform to manage GKE private clusters. Each module will involve at least 7-8 resources. And there are addons. Totally I get about 20 resources per cluster. And I have easily 50 clusters. That will be 1000 yamls to manage?
Plus, there are dependencies between the 30 resources. How is the controller helping on that aspect?

@chivalryq
Copy link
Member

Terraform controller use terraform CLI image to operate tf file. In .tf file you can specify module URL, that's fine. So it should be one YAML for one cluster.

apiVersion: terraform.core.oam.dev/v1beta1
kind: Configuration
metadata:
  name: alibaba-rds-mysql-hcl
spec:
  remote: https://github.com/kubevela-contrib/terraform-modules.git
  path: alibaba/rds # a main.tf here

In main.tf, it contains source block which involve a module. In your case, a GKE cluster can also be organized in a module and use it in main.tf.

When you have 50 clusters, you have different number of yamls to manage, depending on how they are different. The worst case is they have totally different variables. In this case, there are 50 yamls to manage.

If some of them have the same variables, then the yamls should only be different in metadata.

In short, whether it's a dependency issue or modules, terraform-controller support it by using terraform CLI in Job.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants