Kubernetes Cluster API Provider for Terraform Cloud
MPL-2.0 License
Warning Please note that this is a technical preview and is for experimental purposes only. Please open issues generously if you have feedback.
Kubernetes-native declarative infrastructure using Terraform Cloud.
The Cluster API project brings declarative Kubernetes-style APIs to cluster creation, configuration and management. This provider allows you to create Terraform Modules to implement Cluster API's contracts and run them in Terraform Cloud to provision the infrastructure using Kubernetes as your source of truth.
The provider currently implements the contracts that allow the infrastructure for managed clusters and machine pools to be provisioned.
You’ll need a Kubernetes cluster to run against. You can use kind or minikube to get a local cluster up and running.
make install
IMG
:make docker-build docker-push IMG=<some-registry>/cluster-api-provider-terraform-cloud:tag
IMG
:make deploy IMG=<some-registry>/cluster-api-provider-terraform-cloud:tag
NOTE: When run locally controller will automatically use the current context in your kubeconfig file (i.e. whatever cluster
kubectl cluster-info
shows).
For development purposes you can run the controller locally by running:
make run
To delete the CRDs from the cluster:
make uninstall
Remove the controller to the cluster:
make undeploy
This project follows the Kubernetes Operator pattern
It uses Controllers which provides a reconcile function responsible for synchronizing resources until a desired state is reached.
In the case of this provider, the controllers will trigger runs inside Terraform Cloud using Terraform Modules configured in the API resource. The controller will monitor the Terraform Cloud run until is it finished and collect the outputs, using them to fulfill the Cluster API contract of that particular resource.
If you are editing the API definitions, generate the manifests such as CRs or CRDs using:
make manifests
NOTE: Run make --help
for more information on all potential make
targets
More information can be found via the Kubebuilder Documentation and Cluster API Documentation
This project is highly experimental and we welcome contributions in the form of opening issues and pull requests. You can also come and talk to us in #terraform-providers
on the Kubernetes Slack.
Contributors should refer to our Code of Conduct
If you think you've found a security vulnerability, we'd love to hear from you.
Follow the instructions in SECURITY.md to make a report.
By using the software in this repository (the "Software"), you acknowledge that: (1) the Software is still in development, may change, and has not been released as a commercial product by HashiCorp and is not currently supported in any way by HashiCorp; (2) the Software is provided on an "as-is" basis, and may include bugs, errors, or other issues; (3) the Software is NOT INTENDED FOR PRODUCTION USE, use of the Software may result in unexpected results, loss of data, or other unexpected results, and HashiCorp disclaims any and all liability resulting from use of the Software; and (4) HashiCorp reserves all rights to make all decisions about the features, functionality and commercial release (or non-release) of the Software, at any time and without any obligation or liability whatsoever.