Git Product home page Git Product logo

terraform-provider-rke's Introduction

Terraform Provider for RKE

Go Report Card Build Status

Terraform RKE providers can easily deploy Kubernetes clusters with Rancher Kubernetes Engine.

Requirements

  • Terraform >= 0.12.x
  • Go 1.14 to build the provider plugin
  • Docker 17.03.x to run acceptance tests

Installing The Provider

For terraform 0.13 or above users, manual installation is not required anymore. Provider will be downloaded by terraform init from terraform rke registry.

For upgrade terraform to 0.13, please follow upgrade_to_0.13 guide

Note: If you are using terraform 0.12 or lower, the provider should be installed manually. Downloadable packages are available at rke provider releases

How to install manually:

  • Get binary for your platform: curl -L https://github.com/rancher/terraform-provider-rke/releases/download/vX.Y.Z/terraform-provider-rke_X.Y.Z_<OS>_<ARCH>.zip | unzip -
  • Grant execution permission: chmod 755 terraform-provider-rke_vX.Y.Z
  • Place provider binary on your terraform plugin directory: mv terraform-provider-rke_vX.Y.Z <TERRAFORM_PLUGIN_DIRECTORY>
    • terraform init will search the following terraform plugin directories (More info at terra-farm.github.io):
Directory Purpose
. In case the provider is only used in a single Terraform project.
Location of the terraform binary (/usr/local/bin, for example.) For airgapped installations; see terraform bundle.
terraform.d/plugins/_ For checking custom providers into a configuration’s VCS repository. Not usually desirable, but sometimes necessary in Terraform Enterprise.
.terraform/plugins/_ Automatically downloaded providers.
~/.terraform.d/plugins The user plugins directory.
~/.terraform.d/plugins/_ The user plugins directory, with explicit OS and architecture.
/my/custom/path Custom plugin directory. Use the -plug-dir=/my/custom/path when running terraform init

Building The Provider

Clone repository to: $GOPATH/src/github.com/terraform-providers/terraform-provider-rke

$ mkdir -p $GOPATH/src/github.com/rancher
$ cd $GOPATH/src/github.com/rancher

$ go get github.com/rancher/terraform-provider-rke
$ go install github.com/rancher/terraform-provider-rke

Enter the provider directory and build the provider

$ cd $GOPATH/src/github.com/rancher/terraform-provider-rke
$ make build

Current master is focusing on RKE v1.0.x There are some breaking changes from previous provider version.

If you use RKE v0.2.x or v0.1.x, please set proper branch.

Using the provider

If you're building the provider, follow the instructions to install it as a plugin. After placing it into your plugins directory, run terraform init to initialize it. Documentation about the provider specific configuration options can be found at rke provider docs.

Developing the Provider

If you wish to work on the provider, you'll first need Go installed on your machine (version 1.13+ 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 build. This will build the provider and put the provider binary in $GOPATH/bin .

$ make build
...
$ $GOPATH/bin/terraform-provider-rke
...

To just compile provider binary on repo path and test on terraform:

$ make bin
$ terraform init
$ terraform plan
$ terraform apply

Testing the Provider

In order to test structures on the provider, you can simply run make test.

$ make test

In order to run the full suite of Acceptance tests, you can simply run make testacc. scripts/gotestacc.sh will be run, deploying all needed requirements, running acceptance tests and cleanup.

$ make testacc

Due to network limitations on docker for Mac OSX and windows, on these platforms acceptance tests should run on a dockerized enviroment.

$ make dapper-testacc

Provider examples

You can view some tf file examples, here.

On Openstack you can use terraform-openstack-rke module.

terraform-provider-rke's People

Contributors

rawmind0 avatar yamamoto-febc avatar abhi1693 avatar ajdindev avatar donovanmuller avatar jbygdell avatar olegtarassov avatar drpebcak avatar invidian avatar remche avatar linecolumn avatar goodsmileduck avatar ondrejsika avatar paraglade avatar argonqq avatar khos2ow avatar javanthropus avatar jeffb4 avatar meangrape avatar stevenimle-honeywell avatar cartyc avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.