Coder Social home page Coder Social logo

consul_practice's Introduction

Consul Practice Cluster

Featuring the latest:

  • Consul
  • Consul Template

Prerequisites

docker version

Client:
 Version:      17.09.0-ce
 API version:  1.32
 Go version:   go1.8.3
 Git commit:   afdb6d4
 Built:        Tue Sep 26 22:40:09 2017
 OS/Arch:      darwin/amd64

Server:
 Version:      17.09.0-ce
 API version:  1.32 (minimum version 1.12)
 Go version:   go1.8.3
 Git commit:   afdb6d4
 Built:        Tue Sep 26 22:45:38 2017
 OS/Arch:      linux/amd64
 Experimental: true

Cluster Up

docker-compose up -d

Version (At time of testing.):

docker exec -it consulpractice_consul-template_1 consul-template --version
consul-template v0.19.0 (33b34b3)

Consul Dashboard:

http://localhost:8500

Add a data item to Consul

docker exec -it consulpractice_consul1_1 consul kv put foo bar

(Data in the UI: http://localhost:8500/ui/#/dc1/kv/)

View the generated template

cat generated_template/out.txt

You can't tail because if the file is held open Consul-template can't update it.

If you want to "tail", try this in another terminal:

while true; do clear; cat generated_template/out.txt; sleep 1; done

and then just update the data:

docker exec -it consulpractice_consul1_1 consul kv put foo lolz

Update the data

docker exec -it consulpractice_consul1_1 consul kv put foo yay_bar

View the updated generated template

cat generated_template/out.txt

Cluster Down

docker-compose down

Cleanup

docker ps -a | grep consul | awk '{ print $1 }' | xargs docker rm
docker rmi consul
rm -f generated_template/out.txt

consul_practice's People

Contributors

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