Posts

Showing posts from September, 2015

A Service shouldn't know about its Environment

Image
Recently I was involved with setting up a build and deploy system for a suite of microservices. Each service was bundled into its own Docker image and deployed by Ansible.  One of the biggest lessons I learnt is the subject of this post.

Background
Project encompasses around twenty microservices (this figure only set to increase).All packaged and deployed as Docker images.Deployment by Ansible.   Some services need to be deployed to different machines on different networks since some are public facing, some backend, some internal etc etc.Different environment variables need to be injected into different running Docker containers.Each service lives in its own git repo.Each service built by CI server which runs project tests and creates a Docker image. Big effort to minimise the amount of work/config required to create a new microservice.
The Problem
Where to store the ansible deployment configuration for each service.

First idea: Each service owns its deployment configuration.
At firs…