Overview
The Terraform Provider for Gardener enables Terraform to provision Kubernetes clusters on chosen cloud providers using Gardener. Currently, it supports AWS, Azure, and GCP.
Prerequisites
- Terraform 0.12+
- Go 1.12 or higher
- Gardener project with kubeconfig access and configured cloud provider secrets
Development
Perform the following steps to build the providers:
-
Build the provider:
go build -o terraform-provider-gardener
-
Move the gardener provider binary into the terraform plugins folder:
On MacOS:
mv terraform-provider-gardener ~/.terraform.d/plugins/terraform-provider-gardener
For other systems and further details, see this document.
Usage
At the moment, the Terraform Provider for Gardener defines a resource type gardener_shoot
which is linked to the corresponding shoot
Gardener resource. The table shows the cloud provider-specific configuration and related examples:
Perform the following steps to use the provider:
-
Go to one of the main.tf
files listed above.
-
Edit the main.tf
file to provide the missing parameters.
-
Initialize Terraform:
terraform init
-
Plan the provisioning:
terraform plan
-
Deploy the cluster:
terraform apply