Git Product home page Git Product logo

tf-do-rancher2's Introduction

Terraform config to launch Rancher 2

Note: requires Terraform v0.13

Summary

This Terraform setup will:

  • Start a droplet running rancher/rancher version specified in rancher_version
  • Create a custom cluster called cluster_name
  • Start count_agent_all_nodes amount of droplets and add them to the custom cluster with all roles
  • Create an ssh_config file in the terraform module directory for connecting to the droplets

Optional adding nodes per role

  • Start count_agent_etcd_nodes amount of droplets and add them to the custom cluster with etcd role
  • Start count_agent_controlplane_nodes amount of droplets and add them to the custom cluster with controlplane role
  • Start count_agent_worker_nodes amount of droplets and add them to the custom cluster with worker role

Other options

All available options/variables are described in terraform.tfvars.example.

Tools

You can add a tools node, which consists of some software that can be used for Rancher tooling like notifiers and logging. See below for more information on the current software included:

Note: replace PRIVATE_IP or PUBLIC_IP with tools-private-ip or tools-public-ip

Software Endpoint View command
ElasticSearch http://PRIVATE_IP:9200 docker logs elasticsearch
Kibana http://PUBLIC_IP:5601 docker logs kibana
SMTP (Mailhog) http://PRIVATE_IP:1025 docker logs mailhog
Echo server for HTTP requests http://PRIVATE_IP:8080 docker logs echo
Syslog (Syslog-NG) http://PRIVATE_IP:514 docker logs syslog
Fluentd http://PRIVATE_IP:24224 docker logs fluentd

SSH Config

Note: set the appropriate users for the images in the terraform variables, default is root

You can use the use the auto-generated ssh_config file to connect to the droplets by droplet name, e.g. ssh <prefix>-rancheragent-all-0 or ssh <prefix>-rancherserver etc. To do so, you have two options:

  1. Add an Include directive at the top of the SSH config file in your home directory (~/.ssh/config) to include the ssh_config file at the location you have checked out the this repository, e.g. Include ~/git/tf-do-rancher2/ssh_config.

  2. Specify the ssh_config file when invoking ssh via the -F option, e.g. ssh -F ~/git/tf-do-rancher2/ssh_config <host>.

How to use

  • Clone this repository
  • Move the file terraform.tfvars.example to terraform.tfvars and edit (see inline explanation)
  • Run terraform apply

tf-do-rancher2's People

Contributors

axeal avatar edgarlanting avatar superseb 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.