This bundle is a bridge between Symfony2 configuration and consul-php-sdk library.
Download the dependency via composer
composer require jcart/consul-api-client-bundle
Install the bundle into your AppKernel. Add the following line to the bundle defintions:
new JC\ConsulApiClientBundle\JCConsulApiClientBundle(),
The configuration supports a list of consul clients.
jc_consul_api_client:
clients:
primary:
host: consul.dev
port: 8500
logger: logger
secret: your_secret_consul_key
For each client configuration defined, the bundle will register the container the following services for each client
jc_consul_api_client.kv.%s
jc_consul_api_client.agent.%s
jc_consul_api_client.health.%s
jc_consul_api_client.catalog.%s
jc_consul_api_client.kv.%s
jc_consul_api_client.session.%s