Skip to content

micwiel/terraform-provider-rancher2

 
 

Repository files navigation

Terraform Provider for Rancher v2

Features WIP

Implemented resources

  • Auth Config providers
    • ActiveDirectory
    • ADFS
    • AzureAD
    • Github
    • FreeIpa
    • OpenLdap
    • Ping
  • Catalogs
  • Clusters
    • Amazon EKS
    • Azure AKS
    • Google GKE
    • Imported
    • RKE
      • Cloud providers adding node pools
      • Custom
  • Clusters & Projects logging
    • Elasticsearch
    • Fluentd
    • Kafka
    • Splunk
    • Syslog
  • Clusters & Projects Role Template Bindings
  • Namespaces
    • Resource quota limits (Rancher v2.1.x or higher )
  • Node Pools
  • Projects
    • Resource quota limits (Rancher v2.1.x or higher )

TODO

  • Node Template

Requirements

Using the provider

  • Build or download rancher2 provider binary from relases
  • Copy rancher2 provider binary to same folder as terraform binary.
  • Create tf file and use it.
$ terraform init
$ terraform plan
$ terraform apply

Building The Provider

Clone this repository and run make:

$ git clone [email protected]:rancher/terraform-provider-rancher2
$ cd terraform-provider-rancher2
  • Building Linux binary. Released at bin/ folder
$ make
  • Building linux, osx and windoes binaries. Released at build/bin/ folder
$ CROSS=1 make

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (version 1.8+ is required). You'll also need to correctly setup a GOPATH, as well as adding $GOPATH/bin to your $PATH.

To compile the provider, run make. This will build the provider and put the provider binary in bin/terraform-provider-rancher2 .

To compile binary on repo path and test on terraform:

$ make
$ terraform init
$ terraform plan
$ terraform apply

Managing vendor dependencies

Go vendor dependencies are managed with Trash and vendor.conf file.

To update vendor dependencies, edit vendor.conf file and execute trash

$ trash

Acceptance tests

For execute acceptance tests, a running rancher HA system and a rancher API key are needed.

To run acceptance tests, export RANCHER_URL with rancher url and RANCHER_TOKEN_KEY with bearer token or RANCHER_ACCESS_KEY with rancher acces key and RANCHER_SECRET_KEY with rancher secret key and execute

$ export RANCHER_URL=<URL>
$ export RANCHER_TOKEN_KEY=<TOKEN>
$ scripts/testacc

About

Terraform Cattle provider for Rancher v2

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 97.2%
  • Shell 1.4%
  • HTML 1.2%
  • Other 0.2%