Externalizing an environmental config using Consul and envconsul

In the previous recipe, we had our Consul service installed and experimented with its key/value capabilities to learn how we could manipulate the data in it in order to integrate Consul with our application and make the data extraction process seamless and non-invasive from an application standpoint.

As we don't want our application to know anything about Consul and have to explicitly connect to it, even though such a possibility exists, we will employ another utility, also created as open source by Hashicorp, called envconsul. It will connect to the Consul service for us, extract the specified configuration key/value tree, and expose it as the environment variables to be used while also launching our application. Pretty cool, right?

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.171.136