pingcap / tidb-operator

TiDB operator creates and manages TiDB clusters running in Kubernetes.
https://docs.pingcap.com/tidb-in-kubernetes/
Apache License 2.0
1.22k stars 493 forks source link

Separate aws/gcp/alibaba terraform scripts into infrastructure module and tidb-cluster module #494

Closed aylei closed 5 years ago

aylei commented 5 years ago

follow up: https://github.com/pingcap/tidb-operator/pull/492#discussion_r284283099

Currently, aws/gcp/alibaba terraform scripts provision the infrastructure (VMs and Kubernetes) and tidb-cluster in one module, which facilitate the overall setup procedure (a.k.a. on-click deployment). However, it is worthwhile to separate it into two modules, and integrates these two modules in the main module to provide the "on-click deployment & management" functionality.

This structure can help us narrow down the cluster management tools we maintain without breaking anything (Current documentations about terraform still works exactly the same way, which is great for quick-start and presentation). We just have to concentrate on 1 or 2 cluster management mechanisms like helm or kustomize in development and documentation. Moreover, users have more flexibility to customize their setup, e.g. multiple tidb-cluster in one managed kubernetes cluster even if we don't have official support now.

A possible use case: when a user investigate the documentations, he/she will find many operation guides and tutorials about certain feature written for the helm chart, and a documentation about deploy tidb-cluster to EKS. He/she may have a hard time figuring out how to apply the guides and tutorials written for helm to the tidb-cluster in EKS.

Another solution is to guide users to modify the tidb-cluster-values.yaml.tpl file, and tell user that the helm operations, modification of values.yaml and helm upgrade, are mapping to the modification of tidb-cluster-values.yaml.tpl and terraform apply in the terraform context, which is sub-optimal because we are exposing the implementation details of our terraform module this way.

gregwebs commented 5 years ago

I think the best way to do this in terraform is to have two modules: infrastructure & helm. We would provide a configuration that binds them together.

gregwebs commented 5 years ago

@aylei is this completed now?

aylei commented 5 years ago

@gregwebs Yes, thank you for your notice!

closed via #650 #658