terraform-provider-gardener

command module
v0.0.10 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 9, 2021 License: Apache-2.0 Imports: 2 Imported by: 0

README

Terraform Provider for Gardener

Overview

The Terraform Provider for Gardener enables Terraform to provision Kubernetes clusters on chosen cloud providers using Gardener. Currently, the Terraform Provider for Gardener 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:

  1. Build the provider:

    go build -o terraform-provider-gardener
    
  2. Move the gardener provider binary into the terraform plugins folder:

    • On MacOS with terraform 0.12

      mv terraform-provider-gardener ~/.terraform.d/plugins/
      
    • On MacOS with terraform >= 0.13

      # Create plugin cache folder
      mkdir -p "$HOME/.terraform.d/plugins/kyma-project.io/kyma-incubator/gardener/0.0.9/darwin_amd64"
      # install binary
      cp terraform-provider-gardener "$HOME/.terraform.d/plugins/kyma-project.io/kyma-incubator/gardener/0.0.9/darwin_amd64"
      

      With the plugin installed in the cache folder as shown above, you can use the source address kyma-project.io/kyma-incubator/gardener for the provider, e.g.

      terraform {
        required_version = ">= 0.13"
        required_providers {
          gardener = {
            source  = "kyma-project.io/kyma-incubator/gardener"
            version = ">= 0.0.9"
          }
        }
      }
      

      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:

Cloud Provider Specification Example
Amazon Web Services schema.go main.tf
Google Cloud Platform schema.go main.tf
Azure schema.go main.tf

Perform the following steps to use the provider:

  1. Go to one of the main.tf files listed above.

  2. Edit the main.tf file to provide the missing parameters.

  3. Initialize Terraform:

    terraform init
    
  4. Plan the provisioning:

    terraform plan
    
  5. Deploy the cluster:

    terraform apply
    

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL