GithubHelp home page GithubHelp logo

consul-in-rancher's Introduction

What it this?

A simple set of files that does only one thing: reliably reproduce my Consul setup in a Rancher distributed environment. I run Docker instances on many geographically remote servers and use Rancher for central management as well as Consul to monitor these nodes.

Rancher is awesome become it provides this distributed container lifecycle management that others, such as the Docker folks themselves, seem to be having a hard time to put together.

Consul is awesome because it is, to my knowledge, the only lightweight monitoring tool that relies on a consensus protocol (here: Raft) to weed out false positives (negatives?)

Ansible is not as awesome as I wish it was but it sure helps ensure configuration consistency without the need for additional agents.

How do I use this?

Step #1: you can use my version of voxxit's super lightweight Consul container -- it relies on Alpine Linux which, you guessed it, is awesome. Or you can use the provided Dockerfile to adapt it to your own needs. If you go with the latter, you will need a Docker Hub account to allow remote Docker setups to see your image:

HA=<your_hub_account>
docker build -t $HA/consul .
docker login --username=$HA --email=<your_hub_email>
docker tag <your_image_hash> $HA/consul:latest
docker push $HA/consul

Step #2: Edit your Ansible host file so that your consul hosts will be properly listed. It is important for the bootstrap server to be the first one in the host list. So, provided you stick with my choice to call said group 'rancher' your list will look something like:

[rancher]
<hostname> ansible_host=<ip address>
<hostname> ansible_host=<ip address>
<hostname> ansible_host=<ip address>
...

If you decided to create your own image, you will need to edit consul_docker_compose.j2 to reflect that. Be very careful as Jinja-in-Ansible does not handle indentation of {% statements well. Like, at all.

Step #3: Update setup_consul.yml to use your own work directory. You may also remove the rancher-compose up statement and run in manually if you are interested in the bootstrapping process' output.

Run ansible:

ansible-playbook setup_consul.yml

Using Rancher's console, admire the whole process as it comes to life.

OK, I think this README file may now contain more text than the configuration files themselves. Simplicity!

Who are you?

Chris Ravenscroft. I do various things and tend to forget to document them.

-- https://nexus.zteo.com

consul-in-rancher's People

Contributors

fusion avatar

Watchers

 avatar  avatar  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.