Skip to content

castocolina/consul_mini_ws

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Workshop to learn using hashicorp Consul agent & template

The objective of this small workshop is only to use Consul as key/value configration store

Overview

Main Goals

  1. Tools installation
  2. Start Agent node
  3. Add data from CLI
  4. Exercise 1: Using templates
  5. Exercise 2: CLI Program. Use Add / Change data from UI
  6. Exercise 3: Rest program. Using config file for templating and exec behavior
  7. Exercise 4: Rest program. Spring configuration, only reload beans afected by keys/config
  8. Exercise 5: Rest program. Multiple Spring configurations, format = yaml
  9. Security

Tools Installation

Excute:

make install-tools

Or visit:

Start Agent node

Execute: make run-local

Execute: make open-ui to open the consul agent UI

Add data

Execute: make add-data

Exercise 1: Using templates

Template once. Create template and parse file from data

Execute: make exercise1

Exercise 2: CLI Program. Use Add / Change data from UI

Exec mode. Template once before start application and make changes for proccess control (kill and start)

Execute: make exercise2

Exercise 3: Rest program. Using config file for templating and exec behavior

Config options with npm sample app. Use template, start application & restart with each changes

Execute: cd reading/exercise3/api-server && npm i && cd ../../../ to install node dependencies

Execute: make exercise3

Execute: make open-exercise3 to open the rest endpoint

Exercise 4: Rest program. Spring configuration, only reload beans afected by keys/config

Load the application & change the greeting message prefix

Execute: make exercise4

Execute: make open-exercise4 to open the rest endpoint

Exercise 5: Rest program. Multiple Spring configurations, format = yaml

Load the application & change the greeting message for application and common settings

We have 2 yaml config keys:

  • my-team/common/data
  • my-team/consul-demo2/data

These have a default prefix: my-team

with paths:

  • common
  • consul-demo2

Execute: make exercise5

Execute: make open-exercise5 to open the endpoints

TODO

  1. Security
  2. Cluster configurations

Links:

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published