Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ


Choose your language

InfoQ Homepage News FOSDEM Configuration Management: Consul First Steps and Orchestration of Services with Juju

FOSDEM Configuration Management: Consul First Steps and Orchestration of Services with Juju

FOSDEM, the Free and Open Source Software Developers' European Meeting, took place this weekend in Brussels, Belgium, with over 4000 participants. This year the conference had over 40 tracks, both official and developer rooms organized by different communities, dedicated to diverse subjects such as Ruby, virtualization or config management.

What follows is an excerpt of the talks about Consul and Juju at the config management developer room.

Consul First Steps: Learning Service Discovery

Marc Cluet, head of operations at Gluru, talked about service discovery with Consul, a service discovery system designed to run distributed, highly available and scalable to thousands of nodes, previously covered at InfoQ.

There are two pieces in the system, servers and clients. The servers communicate using a gossip protocol between them and choose the leader automatically, and, in order to have quorum, at least three servers should be used. The clients sit in each server to be managed. Consul can be installed with modules for Puppet, Chef and Ansible.

This is some of the functionality that Consul provides, with advice from Marc:

  • DNS publication. Consul provides a DNS interface to access the services, which can also be configured with dnsmasq to make Consul respond to all requests ending for a .consul domain, i.e.
  • Key/value storage, with the caveat that the value is limited to 256kb.
  • Service publication, using json for data.
  • Health checking. Checks need to be solid, i.e. if Consul checks every 10 seconds make sure your check takes less than 10 seconds to complete or Consul will take the services offline. Consul can be used with a tool like PagerDuty to monitor the services with no other tools.
  • Provides a HTTP RESTful API. Including API blocking queries that wait until a condition happens.
  • Uses encryption. The gossip protocol used between nodes is encrypted with KPI, and TLS is used to verify the authenticity of servers and clients.

A Consul command highlighted was consul watch, which provides a mechanism to watch for changes to a particular data entry and invoke a process with the latest value, executing a script when the condition happens.

Other related tools in the Consul ecosystem:

  • Envconsul publishes environment variables with data from Consul.
  • Consul-replicate for cross datacenter replication of the keys and values in Consul.
  • Consul Template stores templates of config files, watches for changes in Consul and reloads the service. Useful for Nginx to refresh backends for instance.
  • Registrator is a service registry bridge for Docker that can register the containers in Consul.

Orchestration of Services with Juju

Charles Butler, software engineer at Canonical, introduced Juju, an Ubuntu project to automate cloud infrastructure. Its original goal is the delivery of applications, through development, deployment and operations, encapsulating ops knowledge in any environment (cloud, bare metal,...) and providing a dynamic infrastructure with interchangeable services. Juju is used by Ubuntu to install OpenStack.

Juju uses the concept of charms, declarative service definitions that encapsulate application configurations, defining how services are deployed, how they connect to other services and are scaled. Charms are shared in the Juju store, where they are rated and reviewed, and all the charms go through CI across all supported environments.

Juju charms configuration management is language independent, using Ansible, Puppet, Chef,... and focus on operational intelligence, relationships between services using integration paths, requires and provides. They define a loosely defined contract between what charms require and what they provide, and are created with Ubuntu in mind.

Juju bundles are sets of services with a specific configuration and their corresponding relations that can be deployed together via a single step. Instead of deploying a single service, bundles can be used to deploy an entire workload, with working relations and configuration. Juju also provides a GUI that allows introspection of bundles and charms.

Orchestration is agility. Bundles define the entire infrastructure in a single file for development, staging and production.

Juju can be used in most public clouds, and using a manual provider it can deploy to any cloud. Furthermore, using Ubuntu MAAS it can orchestrate bare metal.

Rate this Article