Installation

Setup dev mode:

consul agent -dev

In Kube minikube

Consul setup is a simple

docker pull consul
kubectl create -f kube-consul.yaml 

or in helm3

helm3 install consul --version xx --generated-name 

that sets up a pod running consul in our minikube environment.

Consul creates a volume called /consul/data on to which you can store configuration key-value pairs in JSON format that could be directly imported using consul kv import @file.json. consul kv export > file.json can be used to export all stored configuration separated into JSON blobs by namespace.

The consul commands can be run from inside the Consul container by starting a shell in it using

docker exec -ti <consul-container-name> /bin/sh

Configuration setup using Key Value pairs - Web UI

The namespaces for each microservice are defined either manually in the UI or via REST calls such as:

The CLI is app(or namespace)/key and value

consul kv put my-app/my-key my-value

or similar via the web interface

 
consul.txt · Last modified: 2020/01/27 05:45 by root
 
RSS - 200 © CrosswireDigitialMedia Ltd