Cluster-api: [Question] Is it a good way to integrate cluster api with terraform

Created on 22 Mar 2019  路  6Comments  路  Source: kubernetes-sigs/cluster-api

Terraform is a tool for building, changing, and versioning infrastructure safely and efficiently. Terraform can manage existing and popular service providers as well as custom in-house solutions.

The cluster-api is now hosting many different projects to integrate with different cloud providers, like aws, openstack, vsphere etc. Is it possible to create a cloud provider based on terraform so that this provider can work with different clouds?

kinsupport

Most helpful comment

I do believe that is best path forward. post-v1alpha1 we will be working towards reducing the complexity of building and maintaining providers as well.

All 6 comments

This is something that has come up a few times in the past as well. There was even an in-tree vSphere provider at one point that leveraged Terraform.

I don't think there would be any objection from the community if someone wanted to build and maintain a Terraform provider for cluster-api.

That said, personally I'm not a fan of the approach for a few different reasons:

  • Managing the version of Terraform and providers used in the provider, especially around bug handling
  • Complexity of handling some user-provided pre-existing infrastructure or fully managed infrastructure with some level of granularity
  • Having to manage/persist the Terraform state file
  • Having to wrap and shell out to the terraform executable (since there is no support or guarantees around leveraging Terraform as a library)

Thanks @detiber, so seems your major concern is usability and complexity if create a cloud provider with terraform? So the best practise for cluster-api is we encourage each cloud has a provider?

I also found @timothysc has a blog here https://blogs.vmware.com/cloudnative/2019/03/14/what-and-why-of-cluster-api/ , and I can see the major advantage of cluster-api is we want to use kubernetes native way to manage those kubernetes clusters.

I do believe that is best path forward. post-v1alpha1 we will be working towards reducing the complexity of building and maintaining providers as well.

@davidewatson please comment and close por favor.

With the Machine States & Preboot Bootstrapping proposal it should be possible to build an Infrastructure controller based on terraform. While I think there can/will be better native providers for most infrastructure, I agree that there might be value in a terraform provider in terms of speed of implementation. If someone wants to write one we can add a link to the known providers list, but I don't think we need this issue unless someone is actively working on this.

/close

@davidewatson: Closing this issue.

In response to this:

With the Machine States & Preboot Bootstrapping proposal it should be possible to build an Infrastructure controller based on terraform. While I think there can/will be better native providers for most infrastructure, I agree that there might be value in a terraform provider in terms of speed of implementation. If someone wants to write one we can add a link to the known providers list, but I don't think we need this issue unless someone is actively working on this.

/close

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Was this page helpful?
0 / 5 - 0 ratings